Archived
This forum has been archived. Please start a new discussion on GitHub.
link error: error LNK2001: unresolved external symbol __imp___assert
Hi!
I have put the slice definitions and the generated source code in a simple static library project in order to simplify sharing between client and server.
Building the library itself works just great, but when I try to compile the server (started out with a win32 console app project) I get the following linking error because of the static library that contains only the autogenerated code:
Linking...
IceIF.lib(Datenbank.obj) : error LNK2001: unresolved external symbol __imp___assert
Debug/Server.exe : fatal error LNK1120: 1 unresolved externals
I do not know where this __imp___assert comes from. It must get included through a macro, but nothing similar appears in any headers on my system...
One final thing: I recompiled all of Ice against STLPort, but the demos work without problems.
Any ideas?
Regards,
Gregor
I have put the slice definitions and the generated source code in a simple static library project in order to simplify sharing between client and server.
Building the library itself works just great, but when I try to compile the server (started out with a win32 console app project) I get the following linking error because of the static library that contains only the autogenerated code:
Linking...
IceIF.lib(Datenbank.obj) : error LNK2001: unresolved external symbol __imp___assert
Debug/Server.exe : fatal error LNK1120: 1 unresolved externals
I do not know where this __imp___assert comes from. It must get included through a macro, but nothing similar appears in any headers on my system...
One final thing: I recompiled all of Ice against STLPort, but the demos work without problems.
Any ideas?
Regards,
Gregor
0
Comments
-
Hi Gregor,
When you build and link your static library, I recommend you use /MDd [debug] or /MD [release], which means use the DLL runtime libraries. With Visual C++ 6, you can set which runtime to use in Project Settings, C/C++ tab, "Code Generation" category, Use run-time library drop-down list.
You may be using /MTd (Debug Multithreaded), which could explain this link error.
Cheers,
Bernard0 -
This helped. Thank you.
I hate MSVC for things like that ;-)
Regards,
Gregor0