Building OgreBullet on Mac OSX 10.9

symsystem

21-07-2014 11:30:09

Hi everybody ! :)

I'm trying to build OgreBullet on Mac OSX Maverick (10.9). I compiled the last Ogre 1.9 and Bullet 2.82 with CMake (2.8-12) which generate "Unix Makefile".
Ogre is installed on /opt/local/lib and Bullet on /usr/local/lib.
The version of boost library is 1.55.0, and the compiler is Clang (I think it's the default compiler installed with XCode) that use gcc 4.2.1.

Everything works up to the last step of compilation :
- CMake generate the "Unix Makefiles" for OgreBullet
- I enter "make -j2" in the Terminal and everything is building.
But each time it fails in step "linker": :(

Linking CXX shared library libOgreBulletDynamics.dylib
Undefined symbols for architecture x86_64:
"btAlignedFreeInternal(void*)", referenced from:
OgreBulletDynamics::PointToPointConstraint::PointToPointConstraint(OgreBulletDynamics::RigidBody*, Ogre::Vector3 const&) in OgreBulletDynamicsPoint2pointConstraint.cpp.o
....

I've tried to compile with "static library" and it works fine.

Do you have any idea where the problem comes from?

Big thanks in advance! :D

AlexeyKnyshev

25-07-2014 18:18:10

Sometimes u need to force compiler (and linker so) use PIC on x86_64. I don't know which compiler do u use (clang or g++) but enbling PIC in CMakelists.txt by adding line add_definitions(-fPIC) resolving symbol lookup error on Linux (g++), but make sure that I have had more clear error msg from ld about PIC and it may not work for u.

Regards, Alexey Knyshev