Problem linking Bullet in XCode on device only

thepog
Posts: 5
Joined: Thu Apr 21, 2011 3:37 pm

Problem linking Bullet in XCode on device only

Post by thepog »

[Issue resolved]

Hello,

I am experiencing a rather odd problem. It's probably fairly simple, but I'm somewhat new to XCode and am just now learning how to include things like Bullet into a project.

What I have done:
Created a new project in XCode
Edited the 'Debug' and 'Release' Header Search Paths to include the Bullet src directory
Changed any source files that import Bullet source to use sourcecode.cpp.objcpp
Used cmake to create libraries to solve a prior linking issue
Imported said libraries into XCode project

Everything compiles and runs fine if I'm using the iOS simulator. But as soon as I switch to build on 'device' I get link errors for any Bullet object I try to create or use. I don't get any errors, obviously, for simply importing the Bullet libraries in my source; just when I try to make something. I do have an Apple dev membership and a provisioned device connected. I have never seen this problem with any of my previous projects.

Here is an example of the error output for when I try to create a btDbvtBroadphase object:

Code: Select all

ld: warning: in /Users/pogalog/Documents/Project/bullet-2.78/bullet-build/src/LinearMath/LinearMath.framework/LinearMath, missing required architecture armv7 in file
  "btDbvtBroadphase::btDbvtBroadphase(btOverlappingPairCache*)", referenced from:
      -[ES2Renderer render] in ES2Renderer.o
ld: symbol(s) not found
I notice that it is saying the framework LinearMath.framework is missing, but I have actually included it in the project. Not sure what the problem is. :?

Also, I am having a problem importing or using any Bullet inside of one of my Objective-C header files. I will end up with ~1000 compile errors. I can only seem to successfully import into a '.m' file.

Thanks for any help you can offer!
Nathan


Update: Heeding the warnings given by the compiler, I think I realize that the problem must be that the frameworks compiled by cmake didn't include the armv7 architecture as will be needed for use on an iOS device. I tried using the same cmake command found here: http://bulletphysics.org/mediawiki-1.5. ... ork_Recipe but added in 'armv7' into the architectures. Like so:

Code: Select all

cmake .. -G "Unix Makefiles" -DINSTALL_LIBS=ON -DBUILD_SHARED_LIBS=ON -DFRAMEWORK=ON \
   -DCMAKE_OSX_ARCHITECTURES='armv7;i386;x86_64' -DCMAKE_BUILD_TYPE=RelWithDebInfo \
   -DCMAKE_INSTALL_PREFIX=/Library/Frameworks -DCMAKE_INSTALL_NAME_DIR=/Library/Frameworks \
   -DBUILD_DEMOS:BOOL=OFF
The problem is that I get an error when I try to run 'make.'

Code: Select all

c++-4.2: error trying to exec '/usr/bin/arm-apple-darwin10-g++-4.2.1': execvp: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/bu/bu4yGaZfHTOArM8QNd0Yv++++TI/-Tmp-//ccwNeb7n.out
Update Again:
It looks like I solved the problem. I found another post on this forum that just allows me to have XCode build without compiling Bullet into frameworks.
http://www.bulletphysics.org/Bullet/php ... &f=&t=2759

Compiler is still giving me about 500 warnings, but all seems to actually be running just fine. Thanks for looking!
Nathan