Page 1 of 1

Bullet 2.82 and OSX 10.8 Examples Build Error

Posted: Sat Mar 14, 2015 4:09 am
by NickHardeman
Hello,

Thank you for the amazing lib.
I have been able to compile the static libs. I have not been able to compile the ALL_BUILD target using the generated XCode project. It always fails on the AppAllBulletDemos with the following error:

duplicate symbol __ZN15DemoApplication20localCreateRigidBodyEfRK11btTransformP16btCollisionShape in:
/Applications/OpenFrameworks/OF_Addons/ofxBullet/Bullet-src/bullet-2.82-r2704/build-osx/Demos/AllBulletDemos/BULLET_PHYSICS.build/Release/AppAllBulletDemos.build/Objects-normal/x86_64/BenchmarkDemo.o
/Applications/OpenFrameworks/OF_Addons/ofxBullet/Bullet-src/bullet-2.82-r2704/build-osx/Demos/OpenGL/Release/libOpenGLSupport.a(DemoApplication.o)
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Is there a quick fix for this problem? I would love to check out the examples.

Thank you,
Nick

Re: Bullet 2.82 and OSX 10.8 Examples Build Error

Posted: Sat Mar 14, 2015 2:40 pm
by drleviathan
The error text is providing the clues you need to make the build work. It says that there is a duplicate symbol in the object file BenchmarkDemo.o. If you were to know that the BenchmarkDemo.o file is the compiled results of the BenchmarkDemo.cpp file then you would have an idea where to look for the problem code.

Your first task is to find a file called BenchmarkDemo.cpp somewhere in the codebase and open it up in an editor. You're looking for the implementation of a function called localCreateRigidBody as per the pattern of the name-mangled symbol. You'll find that it is wrapped in an #ifndef USE_GRAPHICAL_BENCHMARK preprocessor check which means you can disable it my defining that preprocessor variable, or you can just comment out that entire function.

Re: Bullet 2.82 and OSX 10.8 Examples Build Error

Posted: Sat Mar 14, 2015 7:35 pm
by NickHardeman
Thank you for the prompt replay. Adding in the #define fixed the problem.