Problem building static iPhone libraries

Discuss any Chipmunk bugs here.
Post Reply
SadlyNot
Posts: 2
Joined: Fri Feb 24, 2012 10:57 am
Contact:

Problem building static iPhone libraries

Post by SadlyNot »

This one's an oldy, but everyone seems to be having slightly different problems. I'm trying to build static iPhone libraries from the latest Github revision of chipmunk-physics but the iphone-static.command script in xcode/ fails.

The first error I get is that the iphoneos4.3 SDK doesn't exist, so I changed both SDKs to be version 5.0.

The second error happens in the check dependencies stage when building the iphonesimulator static library (Debug):

[BEROR]No architectures to compile for (ARCHS=armv6 armv7, VALID_ARCHS=i386).

I don't understand how to fix the error, is anyone else experiencing this problem? I'm developing on Mac OSX Lion with Xcode version 4.2.1, Build version 4D502.

I've also tried building from xcode instead of the terminal, but I'm unsure how to switch properly between building Release and Debug libraries for iphoneos and iphonesimulator. I know I could just include the sources in my project and build from there but from what I understand that's not recommended - I'd like to use the static libraries.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Problem building static iPhone libraries

Post by slembcke »

Hmm. So with the 4.3 simulator SDK, it always just figured out that you really wanted to compile for i386. Like it does in Xcode, when you compile for the simulator, it overrides whatever architectures you had set and just sets i386 anyway. I always thought that was a bit weird...

Anyway, the fix is apperently simple enough. The two build lines should look like this to compile against the 5.0 SDK. You already switched the sdk argument, you just need to add the '-arch i386' argument.

Code: Select all

xcodebuild -project Chipmunk6.xcodeproj -sdk iphoneos5.0 -configuration Release -target ChipmunkStatic-iPhone && \
xcodebuild -project Chipmunk6.xcodeproj -sdk iphonesimulator5.0 -arch i386 -configuration Debug -target ChipmunkStatic-iPhone && \
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
SadlyNot
Posts: 2
Joined: Fri Feb 24, 2012 10:57 am
Contact:

Re: Problem building static iPhone libraries

Post by SadlyNot »

Woohoo! Compiling with no problems :) thanks a lot for your help.

While you're around ... will any of those settings need to change if I am compiling for a different version of the SDK or simulator, say 4.3 or older? Or am I free to simply change the version number now?

Also, if that change is appropriate to push to Github that would be much appreciated.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Problem building static iPhone libraries

Post by slembcke »

Compiling against the 5.0 SDK should be fine even if you want to deploy to iOS 4.x. The issue is that from the command line interface, there is no "Latest SDK" option like there is from within Xcode. I usually bump the SDK number up a few months after an SDK is released. If I do it right away, then only the people that upgraded right away will be able to compile it without editing the script. It's probably time to change it to 5.0 now though.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests