Building static library for iOS 7.1 SDK

Discuss any Chipmunk bugs here.

Building static library for iOS 7.1 SDK

Postby ayushv » Sun Mar 23, 2014 2:57 am

I am facing a problem building the static library for iOS 7.1 SDK.

I downloaded Chipmunk 6.2.1, and when I ran the iphonestatic.command from the Xcode directory, the build fails with the following error:


The following build commands failed:
CompileC build/ /Development/Iphone/Chipmunk/Chipmunk-6.2.1/src/cpCollision.c normal armv7 c
(1 failure)
Command failed with status 16640: xcodebuild -project Chipmunk6.xcodeproj -sdk iphoneos7.1 -configuration Release -target ChipmunkStatic-iPhone
Build errors encountered. Aborting build script
Check the build log for more information: /var/folders/dc/tkqpb2rd42909fzblf7spbhm0000gn/T/Chipmunk-20140323-1924-1eksmzy-0
/Development/Iphone/Chipmunk/Chipmunk-6.2.1/xcode/iphonestatic.command:42:in `system': unhandled exception
from /Development/Iphone/Chipmunk/Chipmunk-6.2.1/xcode/iphonestatic.command:50

I'm guessing this has something to do with the architecture settings - armv7, armv7s and arm64 but I've been unable to solve the problem.

A few other points:

1) When I run the iphonestatic.command script for an earlier version of Chipmunk (6.1.1), then it builds the static library against iOS 7.1. However, when I include this static library in my project, then the project only compiles when I drop the arm64 architecture in the build setting, and compile only for armv7 and armv7s

2) The docs mention that the static library contains all the compiler flags required to run Chipmunk at optimum performance. If I forget about generating the static library, and simply use original Chipmunk source files, then what are the compiler flags that I would have to set manually in my project? (This would be useful in case there are issues building static libraries in ANY version).

Any help would be appreciated.

Posts: 14
Joined: Thu Oct 21, 2010 1:52 pm

Re: Building static library for iOS 7.1 SDK

Postby o-simon » Thu Jun 19, 2014 1:33 am

I got the same issue.

Scrolling up a bit I found the source of the error:

Code: Select all
/Users/me/Chipmunk2D/src/cpCollision.c:162:1: error: unused function 'EdgeNew' [-Werror,-Wunused-function]
EdgeNew(cpVect va, cpVect vb, cpHashValue ha, cpHashValue hb, cpFloat r)
1 error generated.

It seems the function EdgeNew is never used, and the compilation settings instructs the compiler to warn on unused functions, and to make warnings into errors.

I went to the file Chipmunck2D/src/cpCollision.c and commented out the EdgeNew function. It compiles. I don't know if it works properly, I haven't tested.
Posts: 5
Joined: Thu Jun 19, 2014 1:26 am

Return to Bugs

Who is online

Users browsing this forum: No registered users and 3 guests