I am trying to link pion network library 4.0.3 in my application. I tried to simply compile pion::netlib in RELEASE_STATIC mode - which worked. However, when I linked against it in my application I get alot of unresolved externals.
Then I found out that RELEASE_STATIC configuration defines PION_STATIC_LINKING, and from another post about another library I found out I probably need to define PION_STATIC_LINKING in my program aswell.
Doing so yields a few 100 errors along the following template:
error LNK2005: _tolower already defined in MSVCRT.lib(MSVCR100.dll) C:\Users\name\Documents\开发者_如何学编程Visual Studio 2010\Projects\myproj\LIBCMT.lib(tolower.obj) myproj
I tried to use /NODEFAULTLIB:libcmt but I still get errors that say certain functions already defined in pion-common.lib / pion-net.lib.
Any ideas? :(
This could most probably be because you are compiling your project using /MT (Multi-threaded) settings for Code Generation, while pion network library was compiled using /MD (Multi-threaded DLL) or vice-versa. Try changing your configuration to /MD if it's /MT or vice-versa. To do this, go to Project -> <ProjectName> Properties... -> Configuration Properties -> C/C++ -> Code Generation
. In the right panel you should be able to see the setting Runtime Library
. Change the options there and rebuild your whole solution.
精彩评论