I am trying to change my windows project from using dynamic linked libs to static libs. I have made what I thought was the necessary change to my project (adding a z to the end of the lib name) but now i am getting unresolved externals, e.g. __imp__ntohl. HELP, what have I missed.
Hi,
That symbol is in the library
WS2_32.lib
which is part of the Windows operating system. It looks like somehow it may no longer be in your link line?Is
__imp__ntohl
the only unresolved symbol you get? If you are really not linkingWS@_32.dll
I would expect many other symbols to be unresolved, things like_imp__htonl, __imp__WSAGetLastError, __imp__WSAIoctl
, etc.You can take a look at the compiler and linker configuration properties and compare them with the ones that are recommended and generated with rtiddsgen when you specify a "Release" instead of a "Release DLL" configuration. If you use VusialStudio, the easiest way to look at them is to right click on the project and select "properties". On the popup select the "Command Line" option under both the "C/C++" entry and the "Linker" entry.
For your reference, these are the properties I have for Release with static linking:
C/C++ Compiling properties
Linking Properties:
See figure: