1
votes

I'm trying to compile the Box2D.xcodeproj from the box2d svn repo. When I loaded up the project I had a warning saying that:

Missing SDK in target Box2D: iphoneos2.2

And when I tried compiling I got two errors:

Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

edit: I poked around a bit more and set the target sdk to be iphoneos4.3 (latest) and now I'm getting just one error:

[BEROR]No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=i386, VALID_ARCHS=armv7).

Any ideas why?

2
in Xcode you should be able to have more details about the error. Look at the right of the error message for an icon that allows you to show the command line results of compiler execution. - sergio
@sergio I edited my answer, is that what you meant? - meds

2 Answers

2
votes

Have you tried going to the Box2D project settings, and changing the selected SDK from "iphoneos2.2" to "Latest iOS" (or whatever you happen to be using in your other projects that build successfully)?

Edit

After your update, it appears that Box2D is configured to build only for the device, and you are attempting to build it for the iPhone simulator. You can test this by trying to build and run on a device (specifically, an iPhone 3GS or above). For a better fix, edit your Box2D project some more, and disable the "Build active architecture only" option, and add i386 and armv6 to your list of valid target architectures. In theory that should clear up the remaining issue.

2
votes

I suspect that the Box2D project is pretty old (due to the reference to iphoneos2.2) and that opening it with a late version of Xcode did not do a good job at converting all the options (I say this because it is pretty common for me to experience this kind of problems with older projects).

In your case I would suggest to try and disable the "Build active architecture only" flag that you can find in the build settings for your project and see what happens. You might also think of resetting all the settings related to the architecture to their default values.

Also, try to compile for the device, just to check if this works.

If my suggestion does not help, the only way I know of troubleshooting this kind of problems is inspecting the project.pbxproj that is found in your Xcode project bundle and get rid of what is wrong (usually, there is some duplication of configuration, or stale information).

PS: the problem with your settings could either be at the project level or at the target level, so inspect both.