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

VS 2005 Linking problem

Started by j0mich01 Oct 16, 2008 at 11:24 AM 1 replies 2.2k views
Original Post
j0mich01
j0mich01
I'm working on a project in VS 2005 and I get the following errors and I can't really figure out why. The problem arises when I link to three libraries, ogg.lib, vorbis.lib, and vorbisfile.lib and looking at the errors it would seem that there is a conflict in what runtime is linked, but it doesn't seem to make sense. I can link to these three libraries in other projects with the exact same settings and everything works fine. I didn't compile the libraries myself, I just downloaded the binaries, so I suppose I'm gonna try to build them myself (verifying the library links to the correct run time) and see if that corrects my problem. I just wanted to see if anyone else has seen this before and what they did to solve it.

LIBCMT.lib(realloc.obj) : error LNK2005: _realloc already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(dosmap.obj) : error LNK2005: __errno already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter_noinfo already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_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: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(calloc.obj) : error LNK2005: _calloc already defined in MSVCRT.lib(MSVCR80.dll)
LIBCMT.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR80.dll)
LINK : warning LNK4098: defaultlib 'MSVCRT' 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

Also I noticed that it advises me to use the /NODEFAULTLIB flag to exclude the conflicting libraries, but I would prefer to build my project in such a way to avoid these conflicts altogether. Any help would be appreciated!
Evil Steve
Evil Steve
That looks to me like the .libs weren't built by your compiler. Are you building them from source? If not, you need to find a version that uses VC2005 (With any service packs you may have). Last I checked there was only VC6 and VC2003 versions available.
The Ogg libs are very straightforward to compile from source though.
j0mich01
j0mich01
I built them from source making sure they used the Multithreaded DLL run time (by default they were set to Multithreaded) and everything compiled corretly after that. Thanks alot! But it does kinda make me wonder why some of my projects compiled correctly previously.

Topic Locked

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

Sign in to reply to this topic.