OgreBullet and MingW

jbuch

06-01-2009 02:16:02

I'm hoping someone here can help. I'm trying to use OgreBullet with a gcc/MingW setup on Windows, but I'm having trouble getting it to link properly. Is anyone using it in this setup? I've tried using the libraries compiled under Visual C++ 2005, and I found a package for Linux that included CMakefiles, which I then used to compile OgreBullet under gcc/MingW, but I continue to receive errors when it gets to the linker phase. Maintaining the gcc/MingW environment is important to my client. I was excited about using Bullet, but may have to go with another solution for physics if we can't get past this.

I've included the error messages I'm receiving in case they are of any use in troubleshooting the problem. I'd appreciate any help.

Jason

AvalancheSR.o: In function `_ZN22AvalancheSRApplication9initWorldERKN4Ogre7Vector3ERKNS0_14AxisAlignedBoxE':
c:/cygwin/bin/simulation/AvalancheSR/AvalancheSR.cpp:216: undefined reference to `OgreBulletDynamics::DynamicsWorld::Dyn
amicsWorld(Ogre::SceneManager*, Ogre::AxisAlignedBox const&, Ogre::Vector3 const&)'
AvalancheSR.o: In function `_ZN22AvalancheSRApplication18initPhysicsTerrainEv':
c:/cygwin/bin/simulation/AvalancheSR/AvalancheSR.cpp:283: undefined reference to `OgreBulletDynamics::RigidBody::RigidBo
dy(std::string const&, OgreBulletDynamics::DynamicsWorld*)'
c:/cygwin/bin/simulation/AvalancheSR/AvalancheSR.cpp:294: undefined reference to `OgreBulletDynamics::RigidBody::setStat
icShape(Ogre::SceneNode*, OgreBulletCollisions::CollisionShape*, float, float, Ogre::Vector3 const&, Ogre::Quaternion co
nst&)'
AvalancheSR.o: In function `_ZNK9__gnu_cxx17__normal_iteratorIPKN4Ogre7Vector3ESt6vectorIS2_SaIS2_EEE4baseEv':
c:/cygwin/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_iterator.h:(.text$_ZN20OgreBulletCollision
s23HeightmapCollisionShapeC1EiiRN4Ogre7Vector3EPfb[OgreBulletCollisions::HeightmapCollisionShape::HeightmapCollisionShap
e(int, int, Ogre::Vector3&, float*, bool)]+0x4c): undefined reference to `OgreBulletCollisions::CollisionShape::Collisio
nShape()'
c:/cygwin/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_iterator.h:(.text$_ZN20OgreBulletCollision
s23HeightmapCollisionShapeC1EiiRN4Ogre7Vector3EPfb[OgreBulletCollisions::HeightmapCollisionShape::HeightmapCollisionShap
e(int, int, Ogre::Vector3&, float*, bool)]+0xc5): undefined reference to `btHeightfieldTerrainShape::btHeightfieldTerrai
nShape(int, int, void*, float, int, bool, bool)'
AvalancheSR.o: In function `main':
c:/cygwin/bin/simulation/AvalancheSR/AvalancheSR.cpp:34: undefined reference to `OgreBulletCollisions::CollisionShape::~
CollisionShape()'
AvalancheSR.o: In function `_ZNK9__gnu_cxx17__normal_iteratorIPKN4Ogre7Vector3ESt6vectorIS2_SaIS2_EEE4baseEv':
c:/cygwin/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_iterator.h:(.text$_ZN20OgreBulletCollision
s25DebugTriangleDrawCallbackD1Ev[OgreBulletCollisions::DebugTriangleDrawCallback::~DebugTriangleDrawCallback()]+0x16): u
ndefined reference to `btTriangleCallback::~btTriangleCallback()'
c:/cygwin/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_iterator.h:(.text$_ZN18btTriangleCallbackC
2Ev[btTriangleCallback::btTriangleCallback()]+0x8): undefined reference to `vtable for btTriangleCallback'
c:/cygwin/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_iterator.h:(.text$_ZN20OgreBulletCollision
s23HeightmapCollisionShapeD0Ev[OgreBulletCollisions::HeightmapCollisionShape::~HeightmapCollisionShape()]+0x16): undefin
ed reference to `OgreBulletCollisions::CollisionShape::~CollisionShape()'
c:/cygwin/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_iterator.h:(.text$_ZN20OgreBulletCollision
s23HeightmapCollisionShapeD1Ev[OgreBulletCollisions::HeightmapCollisionShape::~HeightmapCollisionShape()]+0x16): undefin
ed reference to `OgreBulletCollisions::CollisionShape::~CollisionShape()'
c:/cygwin/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_iterator.h:(.text$_ZN20OgreBulletCollision
s10DebugLines7addLineERKN4Ogre7Vector3ES4_[OgreBulletCollisions::DebugLines::addLine(Ogre::Vector3 const&, Ogre::Vector3
const&)]+0xd): undefined reference to `OgreBulletCollisions::DebugLines::clear()'
c:/cygwin/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_iterator.h:(.text$_ZN20OgreBulletCollision
s25DebugTriangleDrawCallbackD0Ev[OgreBulletCollisions::DebugTriangleDrawCallback::~DebugTriangleDrawCallback()]+0x16): u
ndefined reference to `btTriangleCallback::~btTriangleCallback()'

tuan kuranes

06-01-2009 09:16:09

you need to link to Ogrebullet lib/dll I think.

jbuch

06-01-2009 22:26:25

you need to link to Ogrebullet lib/dll I think.

I am, and it's still generating the errors. Thus the problem. :) In my makefile I'm linking to both OgreBulletCollison.lib and OgreBulletDynamics.lib. I've tried swapping the order of the libraries in the linker, but there's no change.

Both of those were compiled under VS8, so I thought that might be the problem. I located the thread discussing OgreBullet on Linux here:

http://www.ogre3d.org/addonforums/viewtopic.php?f=12&t=4840

And downloaded the tar: http://knightlabs.com/ubc/ogrebullet.tar.bz2

Then I used the CMakefile to generate a gcc/MingW makefile and compiled libOgreBulletCollision.a and libOgreBulletDynamics.a, linked those in, but still receive the errors in the linker when compiling my app.

My LIBDBOPTs:

LIBDBOPT=-lOgreMain_d -lois_d -lCEGUIBase_d -lOgreGUIRenderer_d -lLibOpenGLSupport -lLibLinearMath -lLibBulletCollision -lLibBulletDynamics -lLibGIMPACT -lOgreBulletCollisions -lOgreBulletDynamics

Thanks.

Fish

08-01-2009 04:19:26

Try moving the link order around. I had to experiment quite a bit before it would finally link. My link order is: OgreBulletDynamics, OgreBulletCollisions, BulletDynamics, BulletGimpact, BulletCollision, BulletMath.

ipons

08-01-2009 16:32:10

Hi Jason,

I have successfully built OgreBullet Demo using latest ogrebullet SVN revision 2604 and Bullet-2.73.
I used auto{conf,gen,make} tools to generate Makefiles in MSYS environment. It looks like your
library order is incorrect, try Fish's recommendation.

This is my link flags to build OgreBulletDemo:


LDFLAGS= -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias \
-L$(OGRE_HOME)/lib \
-L$(OGRE_HOME)/Samples/Common/bin/Debug \
-L/usr/local/lib \
-L$(BULLET_HOME)/src \
-lOgreMain_d \
-lOIS_d \
-lOgreGUIRenderer_d \
-lOgreBulletDyn \
-lOgreBulletCol \
-lbulletdynamics \
-lbulletcollision \
-lbulletsoftbody \
-lbulletmath \


Ipon Supriyono

jbuch

12-01-2009 22:08:34

Thanks for the help and the suggestions. I haven't gotten it working yet, but I think I know how to proceed. I'll post an update once I've got it all sorted out. Thanks again.

Jason

molmasepic

09-06-2011 23:33:59

hey how did you find the cmake files needed to build ogrebullet in windows? can you upload them or give a link? i need them too.

PS: sorry for reviving an old post.