Personal computing discussed

Moderators: SecretSquirrel, just brew it!

 
Igor_Kavinski
Gerbil XP
Topic Author
Posts: 391
Joined: Fri Dec 22, 2006 2:34 am

Help with VC++ 2008 Express linker error

Thu Aug 26, 2010 4:59 pm

LIBC.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib(MSVCR90.dll)

I am getting tons of errors like the one above because library A needs LIBC.lib while library B needs MSVCRT.dll. If I use /NODEFAULTLIB:lib, one of the libraries fails to link. Is there an easy way to make them play nice with each other? Like some command line option that forces both libraries to use MSVCRT.lib for common functions while only resorting to LIBC.lib for functions unavailable in MSVCRT.lib?
 
Igor_Kavinski
Gerbil XP
Topic Author
Posts: 391
Joined: Fri Dec 22, 2006 2:34 am

Re: Help with VC++ 2008 Express linker error

Fri Aug 27, 2010 9:20 am

Ah never mind. One of the libraries I was using was an opensource one. Just put all the source files of that library into my VC++ 2008 project and it compiled without errors. Sweet sweet opensource :P
 
Flying Fox
Gerbil God
Posts: 25118
Joined: Mon May 24, 2004 2:19 am
Contact:

Re: Help with VC++ 2008 Express linker error

Tue Aug 31, 2010 3:12 pm

Seems like one library was compiled with "multithreaded" (static linking to C runtime) and another was with "multithreaded DLL" (dynamic linking to C runtime via msvcr90.dll/msvcp90.dll). All of them have to match.
The Model M is not for the faint of heart. You either like them or hate them.

Gerbils unite! Fold for UnitedGerbilNation, team 2630.

Who is online

Users browsing this forum: MSNbot Media and 2 guests