Building static library for iOS 7.1 SDK

Discuss any Chipmunk bugs here.
Post Reply
ayushv
Posts: 14
Joined: Thu Oct 21, 2010 1:52 pm
Contact:

Building static library for iOS 7.1 SDK

Post by ayushv »

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:

** BUILD FAILED **


The following build commands failed:
CompileC build/Chipmunk6.build/Release-iphoneos/ChipmunkStatic-iPhone.build/Objects-normal/armv7/cpCollision.o /Development/Iphone/Chipmunk/Chipmunk-6.2.1/src/cpCollision.c normal armv7 c com.apple.compilers.llvm.clang.1_0.compiler
(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
logout



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.

~thanks
o-simon
Posts: 5
Joined: Thu Jun 19, 2014 1:26 am
Contact:

Re: Building static library for iOS 7.1 SDK

Post by o-simon »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests