Problems Compiling Latest SVN with Bullet 2.74

xwipeoutx

16-03-2009 12:07:43

I'm trying to compile the latest SVN with Bullet 2.74, and I'm havning some issues. Trying it on VS2005

I did the following:
1) Downloaded latest SVN of bullet and ogrebullet
2) Compiled bullet (which went fine)
3) set the bullet home directory to its proper place
4) Applied Fish's patch viewtopic.php?f=12&t=9490
5) Changed the vs library includes to have 'lib' on the front, and fix up the names (bulletcollision.lib was now libbulletcollision.lib, for example)

After this much, OgreBulletCollisions and OgreBulletDynamics compiled just fine, which I was pretty stoked about.

However, when trying to compile Dynamics_Demos I get a bunch of linker errors:

3>msvcprt.lib(MSVCP80.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) already defined in libconvexdecomposition.lib(vlookup.obj)
3>msvcprt.lib(MSVCP80.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in libconvexdecomposition.lib(vlookup.obj)
3>msvcprt.lib(MSVCP80.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in libconvexdecomposition.lib(vlookup.obj)
3>msvcprt.lib(MSVCP80.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in libconvexdecomposition.lib(vlookup.obj)
3>msvcprt.lib(MSVCP80.dll) : error LNK2005: "protected: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Myptr(void)const " (?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IBEPBDXZ) already defined in libconvexdecomposition.lib(vlookup.obj)
3>msvcprt.lib(MSVCP80.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::size(void)const " (?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in libconvexdecomposition.lib(vlookup.obj)
3>msvcprt.lib(MSVCP80.dll) : error LNK2005: "protected: char * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Myptr(void)" (?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEPADXZ) already defined in libconvexdecomposition.lib(vlookup.obj)
3>msvcprt.lib(MSVCP80.dll) : error LNK2005: "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z) already defined in libconvexdecomposition.lib(vlookup.obj)
3> Creating library c:\OgreSDK\bin\Release/OgreBulletDemos.lib and object c:\OgreSDK\bin\Release/OgreBulletDemos.exp
3>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
3>c:\OgreSDK\bin\Release/OgreBulletDemos.exe : fatal error LNK1169: one or more multiply defined symbols found


If I tell it to ignore msvcprt.lib, I get a like 200 unresolved externals (kinda expected...). If I tell it to ignore LIBCMT (as per the warning), I still get those 9 multiply defined symbols (it does remove the warning though, yay!). I'm pretty bad at l inker warnings - does it actually say which

Anyone come across a similar problem? I'm fairly sure I didn't do anything overly fancy here...

Fish

16-03-2009 19:09:58

Make sure you are compiling all of the libs and your executable with the "Multi-threaded Debug DLL (/MDd)" runtime library for debug mode or the "Multi-threaded DLL (/MD)" runtime library for release mode. Especially check your 'Convex Decomposition" project.

You can find those options in Project Properties->Configuration Properties->C/C++->Code Generation->Runtime Library.

-Fish

xwipeoutx

17-03-2009 10:20:56

Doh, of course!

I checked it for OgreBullet, but didn't even think of it in Bullet...

Thanks!