Bullet not linking right.

3DModelerMan
Posts: 20
Joined: Thu Oct 22, 2009 2:02 pm

Bullet not linking right.

Post by 3DModelerMan »

I followed the installation tutorial to link to Bullet. And I made sure the libraries were in the right order. I have the include paths right too. I can declare stuff fine.

Code: Select all

btAxisSweep3* m_Broadphase;
 btDefaultCollisionConfiguration* m_CollisionConfiguration;
 btCollisionDispatcher* m_Dispatcher;
But when I try to initialize them.

Code: Select all

//Bullet initialization.
 int maxProxies = 1024;
 btVector3 worldAabbMin(-10000,-10000,-10000);
 btVector3 worldAabbMax(10000,10000,10000);

 m_Broadphase = new btAxisSweep3(worldAabbMin,worldAabbMax,maxProxies);
 m_CollisionConfiguration = new btDefaultCollisionConfiguration();
 m_Dispatcher = new btCollisionDispatcher(m_CollisionConfiguration);
I get these errors.
-------------- Build: The Last Militia in The Last Militia ---------------

GameManager.cpp
Linking console executable: data\bin\The Last Militia.exe
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.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 LIBCMT.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 LIBCMT.lib(typinfo.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
data\bin\The Last Militia.exe : fatal error LNK1169: one or more multiply defined symbols found
Process terminated with status 1169 (0 minutes, 4 seconds)
5 errors, 1 warnings
RBD
Posts: 141
Joined: Tue Sep 16, 2008 11:31 am

Re: Bullet not linking right.

Post by RBD »

Make sure you're using the same C run-time library across your solution (MSVCRT is a dynamic C rt link lib (DLL); LIBCMT is a static C rt link lib). See Project Properties > Configuration Properties > C/C++ > Code Generation.
3DModelerMan
Posts: 20
Joined: Thu Oct 22, 2009 2:02 pm

Re: Bullet not linking right.

Post by 3DModelerMan »

Ahh thanks. I was accidently compiling my project using VC8, and bullet using VC6. Now they both use VC8 and work fine.