Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I modify existing project to create a new dll within Visual C++

Status
Not open for further replies.

DanAtCDS

Technical User
May 20, 2003
22
0
0
US
Here is what I am up against.
I currently have a couple of Workspaces/Projects set up that are used to calculate auto insurance premiums. Upon building each project, a dll is created and placed in a given directory to be called by a VB6 front end. Everything was set up when I was hired so I've always performed maintanence on this system and never had issues.
However, now I've been asked to create a new "backend" system that will calculate motorcycle premiums. Not just new code within the old dlls, ... they want new dll files to call from the front end. Since the code is almost identical, with the exception of a few database calls and some input and output header changes, I had hoped
I could just copy the old cpp files and header files to another directory, update them with "moto" everywhere "auto" was used.(there is a little more to it than that but not too much) This in turn would allow me to create a new workspace, add a project to it and include the newly created files in order to create my "moto.dll"

Am I making sense or am I grossly oversimplifying things??

At any rate, I have both projects set up with my changes, ... but I get some errors telling me that I am not linking correctly to some vairables:
MotoCalc.obj : error LNK2001: unresolved external symbol _close_database_2@0
MotoCalc.obj : error LNK2001: unresolved external symbol _read_moto_man_opt_2@12
MotoCalc.obj : error LNK2001: unresolved external symbol _open_database_2@0
MotoCalc.obj : error LNK2001: unresolved external symbol _close_man_opt_2@0
MotoPremCalc.obj : error LNK2001: unresolved external symbol _ReadAllRates@16
MotoPremCalc2.obj : error LNK2001: unresolved external symbol _read_all_rates_2@16
Debug/MotoCalc.dll : fatal error LNK1120: 6 unresolved externals

Any suggestions on how to handle this better than what I tried??
I'm just not all that saavy with C++. I can work on what's there but creating things from the ground up isn't really my string suit!

Thanks in advance for any help!
 
So your new project is exactly the same except that some strings are being changed? If that's the case, it might be better to use the same source files instead of making a copy of them, then just move the strings out into a header file where you can use a macro to define those strings as either "auto" or "moto" or whatever else you need. That way, if you fix a bug in the code you don't have copy copy that same fix to multiple copies of the same files.
 
I guess you probably found your answer, but if not...

It sounds like the original dll either had a databse file that si missing from this project, or it had a dependency on some other dll for the database stuff. Missing a linker dependency to another .lib file...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top