Skip to main content
GameDev.net gamedev.net
🔒 Locked

two libs, same function names?

Started by sushi-one Jan 9, 2005 at 5:28 PM 2 replies 2.9k views
Original Post
sushi-one
sushi-one
Im using an external libary for my project, how can I compile when two libs are using the same names? --------------------Configuration: NewPlayerStatic - Win32 Release-------------------- Linking... LIBCMT.lib(tolower.obj) : error LNK2005: _tolower already defined in msvcrt.lib(MSVCRT.dll) LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrt.lib(MSVCRT.dll) LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrt.lib(MSVCRT.dll) LIBCMT.lib(strftime.obj) : error LNK2005: _strftime already defined in msvcrt.lib(MSVCRT.dll) LIBCMT.lib(atox.obj) : error LNK2005: _atoi already defined in msvcrt.lib(MSVCRT.dll) LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrt.lib(cinitexe.obj) LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrt.lib(cinitexe.obj) LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrt.lib(cinitexe.obj) LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrt.lib(cinitexe.obj) LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrt.lib(MSVCRT.dll) LIBCMT.lib(getenv.obj) : error LNK2005: _getenv already defined in msvcrt.lib(MSVCRT.dll) msvcrt.lib(MSVCRT.dll) : error LNK2005: __strdup already defined in LIBCMT.lib(strdup.obj) msvcrt.lib(MSVCRT.dll) : error LNK2005: __strcmpi already defined in LIBCMT.lib(stricmp.obj) msvcrt.lib(MSVCRT.dll) : error LNK2005: __stricmp already defined in LIBCMT.lib(stricmp.obj) msvcrt.lib(MSVCRT.dll) : error LNK2005: __setmbcp already defined in LIBCMT.lib(mbctype.obj) LINK : warning LNK4098: defaultlib "msvcrt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main \PlayerStatic.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. PlayerStatic.exe - 17 error(s), 2 warning(s) The following environment variables were not found $(NEMORDIR)
Hans-Petter Harveg
_the_phantom_
_the_phantom_
you appear to be getting a runtime library clash, make sure everything is being compiled with the same runtime library
Zipster
Zipster
Yeah, it looks like you're linking with both the static and DLL runtimes at the same time! If you go to Project Settings -> C/C++ -> Code Generation -> Runtime Library you can set which version you want to link against, and MSVC should know how to build the proper command line. At least it knows how for me [smile] If you click on the Help button it will also give you some detailed information about the libraries you need to include and exclude for each version.
Shriek
Shriek
Turn off multithreading if you don't need it, that's what's causing the conflict--the linker is linking against both the non-multithreaded and multithreaded versions of the C runtime libraries.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.