[Resolved] Starting a project from scratch using XCode 4.0.2

Jones
Posts: 2
Joined: Sun May 15, 2011 4:10 pm

[Resolved] Starting a project from scratch using XCode 4.0.2

Post by Jones »

Hej,
I'm am trying to use Bullet 2.76 and XCode 4.0.2 in a project. I follow the instructions given on http://bulletphysics.org/mediawiki-1.5. ... sing_XCode, had exactly the problem mentionned in the end of the tutorial, and followed the instructions.

I had this issue: http://bulletphysics.org/Bullet/phpBB3/ ... php?t=6686, but the solution given in this topic worked for me.

Then, in my XCode project, in the main.cpp, I added "#include <BulletDynamics/btBulletDynamicsCommon.h> and the autocompletion even worked for this.

However, I still get exactly the same errors as before, which were:
Undefined symbols for architecture x86_64:
"btAlignedFreeInternal(void*)", referenced from:
btAlignedAllocator<int, 16u>::deallocate(int*) in main.o
btAlignedAllocator<btTriangleInfo, 16u>::deallocate(btTriangleInfo*) in main.o
btAlignedAllocator<btHashInt, 16u>::deallocate(btHashInt*) in main.o
"btTypedConstraint::serialize(void*, btSerializer*) const", referenced from:
vtable for btTypedConstraint in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And were supposed to be solved in the tutorial. Why?

Thanks in advance,
Jones
Last edited by Jones on Sun May 15, 2011 9:35 pm, edited 1 time in total.
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm

Re: Starting a project from scratch using XCode 4.0.2

Post by dphil »

I just tried the same thing with Xcode 4.0.2 and bullet 2.78 and it works for me. Once you ran the cmake/make/install commands in that tutorial, it installs the bullet frameworks to /Library/Frameworks. You need to add a reference to (at least) BulletDynamics.framework and LinearMath.framework to avoid the errors from that one #include statement (though typically you would also include BulletCollision.framework ). The attached screenshot is my project setup:

Image
Jones
Posts: 2
Joined: Sun May 15, 2011 4:10 pm

Re: Starting a project from scratch using XCode 4.0.2

Post by Jones »

Well... I had not added a reference to the frameworks indeed. It is kind of frustrating =). It is actually the first time I use XCode, and I'm not much experienced with programming on an Apple Computer.

Anyway, thanks: From now on, I'll now that I can add references by right-clicking on the project folder in the navigator and "Add files..." in XCode!

Best Regards!
Jones