Building OgreBullet don´t work with MingW/C::B/VC++

0x46B

25-10-2010 17:01:11

Hi everyone.
Maybe I just made some totaly dumb mistakes, but I couldn´t get OgreBullet compiling, it seems that it doesn´t even matter which IDE/Compiler I use. It´s depressing.
I can´t exactly remember the failures of CodeBlocks, but the MingW failed because theres no pkg-config in it (thats no real problem, it´s Windows and these ./autogen.sh etc. stuff is for Linux only, I guess)

I´ve tried the VC Solution with VisualStudio2010 (which didn´t worked at all) and VC++ 2008 Express and after tweaking the whole paths (it hasn´t recognized the environment variables) it compiles everything except the "Dynamics_Demos". That should be okay, if there where the libs I could use in my own stuff, but thats the strange thing: they aren´t, even if VC++ tells me it had build them normally. At building "Dynamics_Demos" he throws much (20 or more) failures like this one:

1>ConvexDecomposition.lib(concavity.obj) : warning LNK4229: Ungültige /FAILIFMISMATCH:_ITERATOR_DEBUG_LEVEL=2-Direktive gefunden; wird ignoriert.
1>ConvexDecomposition.lib(splitplane.obj) : warning LNK4229: Ungültige /FAILIFMISMATCH:_MSC_VER=1600-Direktive gefunden; wird ignoriert.
1>ConvexDecomposition.lib(splitplane.obj) : warning LNK4229: Ungültige /FAILIFMISMATCH:_ITERATOR_DEBUG_LEVEL=2-Direktive gefunden; wird ignoriert.
1>LINK : fatal error LNK1104: Datei "libboost_thread-vc90-mt-gd-1_42.lib" kann nicht geöffnet werden.


I can´t translate the first ones, but the last one says "libboost_thread-vc90-mt-gd-1_42.lib could not be opened".

Here some infos about files I´ve used:

  1. OGRE 1.7.1 SDK for Visual C++ .Net 2010 (32-bit)/OGRE 1.7.1 SDK for MinGW (for C::B and MinGW, changed the OGRE_HOME for different IDEs)
    Bullet 2.77
    OgreBullet out of the SVN, I didn´t know the version
    [/list:u]
    Bullet was build with CMake without problems.
    I am using Windows 7 64 Bit and I could use VisualStudio2010, Visual C++ 2008 Express, CodeBlocks (which I would favour for this) + gcc 4.4.1-dw2 and Mingw/Msys with the same gcc version.

    Has anybody get it working with one of these? I am trying for weeks now...If I should post additional infos please tell me, I will as soon as I can but I didn´t want to throw everything in here because I don´t know what exactly would be useful.

    Thanks in advance,
    0x46B

    P.S.: Oh jeah, did found the "premake.lua" in the directory, but premake 3.5 just builds empty projects with the name OgreBullet or something...

jjmac

02-11-2010 15:51:00

I've successfully compiled with VS2010, however I had to change the project settings. Here are my environment variables:

OGRE_HOME: C:\OgreSDK\OgreSDK_vc10_v1-7-1
BULLET_ROOT: C:\bullet-2.77


These are the only distros you need. The OgreSDK I'm using is the one prebuilt for VS2010, and bullet I built myself using CMake and VS2010. The OgreSDK includes both OIS headers and libs and a trimmed-down set of boost 1.42 headers and libs. You need to change your project settings to match these directories, unless you also have OIS and boost 1.42 and prefer to use those locations instead.

Note that I also moved the Bullet libraries to $(BULLET_ROOT)\bullet-2.77\lib\$(Configuration), where $(Configuration) is either Debug or Release. This makes it easier to setup in a VS2010 project.

Note that when building Dynamic_Demos you may (probably?) get the following error:

error MSB3073: The command "copy \..\bin\Debug C:\Projects\OgreBullet\Demos\Dynamics_Demos\scripts\VC8\..\..\..\Dynamics_Demos.exe

I just copied the Ogre Debug DLLs from $(OGRE_HOME)\bin\debug to the C:\Projects\OgreBullet\Demos (or where ever you have OgreBullet) and ran OgreBulletDynamicsDemo_d.exe. You could tweak the project settings to fix it, I'm just not interested in it (beyond actually running it and referring to the code for examples)

Here's what I changed for the two library projects. Your setup may require tweaking, but it should get you started down the right path:

---------- OgreBulletCollisions ----------
All Configurations
C/C++ | General | Additional Include Directories
OLD: ..\..\include;$(BULLET_ROOT)\src;$(BULLET_ROOT)\Extras\ConvexDecomposition;$(OGRE_HOME)\OgreMain\include;%(AdditionalIncludeDirectories)
NEW: ..\..\include;$(BULLET_ROOT)\src;$(BULLET_ROOT)\Extras\ConvexDecomposition;$(OGRE_HOME)\include\OGRE;%(AdditionalIncludeDirectories)


All Configurations
Librarian | General | Additional Library Directories
OLD: <empty>
NEW: $(OGRE_HOME)/lib/$(ConfigurationName);$(OGRE_HOME)/boost/lib;%(AdditionalLibraryDirectories)

Debug
Librarian | General | Additional Dependencies
OLD: <empty>
NEW: OgreMain_d.lib

Release
Librarian | General | Additional Dependencies
OLD: <empty>
NEW: OgreMain_d.lib



---------- OgreBulletDynamics ----------
All Configurations
C/C++ | General | Additional Include Directories
OLD: ..\..\include;..\..\..\Collisions\include;$(BULLET_ROOT)\src;$(OGRE_HOME)\OgreMain\include
NEW: ..\..\include;..\..\..\Collisions\include;$(BULLET_ROOT)\src;$(OGRE_HOME)\include\OGRE;


All Configurations
Librarian | General | Additional Library Directories
OLD: <empty>
NEW: $(OGRE_HOME)/lib/$(ConfigurationName);$(OGRE_HOME)/boost/lib;%(AdditionalLibraryDirectories)

Debug
Librarian | General | Additional Dependencies
OLD: <empty>
NEW: OgreMain_d.lib

Release
Librarian | General | Additional Dependencies
OLD: <empty>
NEW: OgreMain.lib



---------- Dynamic_Demos ----------
All Configurations
C/C++ | General | Additional Include Directories
OLD: $(BULLET_ROOT)\src;$(BULLET_ROOT)\Extras\ConvexDecomposition;..\..\include;..\..\..\include;..\..\..\..\Collisions\include;..\..\..\..\Dynamics\include;$(OGRE_HOME)\OgreMain\include;$(OIS_HOME)\includes;$(OGRE_HOME)\Dependencies\include
NEW: $(BULLET_ROOT)\src;$(BULLET_ROOT)\Extras\ConvexDecomposition;..\..\include;..\..\..\include;..\..\..\..\Collisions\include;..\..\..\..\Dynamics\include;$(OGRE_HOME)\include\OGRE;$(OGRE_HOME)\include;%(AdditionalIncludeDirectories)


All Configurations
Linker | General | Additional Library Directories
OLD: <i didn't look ...>
NEW: ..\..\..\..\lib\$(Configuration);$(OGRE_HOME)\lib\$(ConfigurationName);$(BULLET_ROOT)\lib\$(Configuration);$(OGRE_HOME)\boost_1_42\lib;%(AdditionalLibraryDirectories)

0x46B

15-11-2010 04:27:26

First of all: a big sorry for the long delay, thought I would get a notice per e-mail if someone is responsing.

Many thanks for your answer, I will check that solution later and post the results here. Got OgreODE working now, but I do not feel very good with it and bullet would be so much greater I guess. I hope it will work. :D

0x46B

19-11-2010 14:41:26

Okay, I have tried it now and the demo works fine without problems! Many thanks, I will now begin to test it a little within my project. :D :D