Page 1 of 1

error LNK2038: mismatch detected for 'RuntimeLibrary'

Posted: Thu Jan 29, 2015 5:07 pm
by oskr1709
Hello! I´m new in this topic, I hope you can help me.

I'm using Bullet Physics, on Windows 8.1 and Visual Studio 2012. I have compiled the libraries without problems but when try to link Bullet with Simox to build this software I have the next errors:

15>BulletDynamics_Debug.lib(btDiscreteDynamicsWorld.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in DynamicsWorld.obj
15>BulletDynamics_Debug.lib(btRigidBody.obj) : error LNK2038: error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in DynamicsWorld.obj
15>BulletDynamics_Debug.lib(btHingeConstraint.obj) : error LNK2038: error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in DynamicsWorld.obj

...

43>BulletDynamics_Debug.lib(btRigidBody.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in BulletDebugViewerWin32.obj
43>BulletDynamics_Debug.lib(btPoint2PointConstraint.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in BulletDebugViewerWin32.obj

...

What should I do?

Re: error LNK2038: mismatch detected for 'RuntimeLibrary'

Posted: Fri Jan 30, 2015 1:39 am
by anthrax11
Since you seem to be building a DLL, then Bullet also needs to be compiled with the Multi-threaded DLL runtime library. So if you use CMake to build Bullet, set the USE_MSVC_RUNTIME_LIBRARY_DLL flag. I don't know if there is any such option for Premake.

More info here: https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx

Re: error LNK2038: mismatch detected for 'RuntimeLibrary'

Posted: Fri Jan 30, 2015 5:56 am
by oskr1709
Thank you so much! That works perfectly!