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

ODE & Linker

Started by Omaha Apr 11, 2005 at 1:15 AM 2 replies 700+ views
Original Post
Omaha
Omaha
I'm adding ODE (Open Dynamics Engine, physics stuff) to my project so I wrote out a few stubs and added the .libs to the linker input section of the build configuration. I've also configured ODE via the batch files provided (v.5) and built the libraries, both in release and debug modes. The problem is, whenever I try to build my application that uses ODE, I end up with a pile of multiply-defined symbol linker errors. z.b:

inking...
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _fflush already defined in LIBC.lib(fflush.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _exit already defined in LIBC.lib(crt0dat.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _abort already defined in LIBC.lib(abort.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _malloc already defined in LIBC.lib(malloc.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _realloc already defined in LIBC.lib(realloc.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _free already defined in LIBC.lib(free.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _memmove already defined in LIBC.lib(memmove.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBC.lib(typinfo.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBC.lib(typinfo.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

I then went back to the ODE workspace and disabled all default libs from being linked in, thinking that might solve it, but that didn't change anything, except forcing me to rebuild. Very confusing, and one of the many reasons I get wary about merging third party libraries with my programs; there always seems to be a linker complaint to fix first. Anyone have suggestions/ideas from the tops of their heads, or perhaps deeper?
Drew_Benton
Drew_Benton
Try changing the run-time library to MultiThreaded DLL. IIRC ODE needs that linking seting.
Omaha
Omaha
Meaning in the ODE build? I'm using it in static library mode, and the debug build for ODE is already set for multi-threaded debug mode.

Unless my memory is failing me, I'll have to wait until tonight to play with it again, but very frustrating when I was ready to start making things fall down and instead my linker cries like a little girl.
IndyJones
IndyJones
You can try the following:
Go to the Linker settings of your project, choose Input and add libc.lib to the "Ignore Specific Library" field.

Regards Martin

Topic Locked

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

Sign in to reply to this topic.