Building Static Library - Errors

Official forum for the Chipmunk2D Physics Library.
Post Reply
HeshamAmiri
Posts: 6
Joined: Sat Apr 28, 2012 10:33 am
Contact:

Building Static Library - Errors

Post by HeshamAmiri »

I'm new to ChipmunkPro and this is the steps that I have done:

1. Created a ne Cocos2d project with Chipmunk
2. deleted the Chipmunk directory in the project
3. I use the iphonestatic.command to build the library ( against the 5.1 SDK), I get success on some of the builds but I also get these errors

Code: Select all

** BUILD FAILED **


The following build commands failed:
        CompileC build/ChipmunkPro.build/Release-iphoneos/ObjectiveChipmunk.build/Objects-normal/armv6/ChipmunkMultiGrab.o Objective-Chipmunk/ChipmunkMultiGrab.m normal armv6 objective-c com.apple.compilers.llvm.clang.1_0.compiler
        CompileC build/ChipmunkPro.build/Release-iphoneos/ObjectiveChipmunk.build/Objects-normal/armv6/cpSpaceQuery.o Chipmunk/src/cpSpaceQuery.c normal armv6 objective-c com.apple.compilers.llvm.clang.1_0.compiler
        CompileC build/ChipmunkPro.build/Release-iphoneos/ObjectiveChipmunk.build/Objects-normal/armv6/ChipmunkSpace.o Objective-Chipmunk/ChipmunkSpace.m normal armv6 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(3 failures)
lipo: can't open input file: build/Release-iphoneos/libObjectiveChipmunk.a (No such file or directory)
** BUILD FAILED **


The following build commands failed:
        CompileC build/ChipmunkPro.build/Release-iphoneos/ObjectiveChipmunk.build/Objects-normal/armv6/ChipmunkMultiGrab.o Objective-Chipmunk/ChipmunkMultiGrab.m normal armv6 objective-c com.apple.compilers.llvm.clang.1_0.compiler
        CompileC build/ChipmunkPro.build/Release-iphoneos/ObjectiveChipmunk.build/Objects-normal/armv6/cpSpaceQuery.o Chipmunk/src/cpSpaceQuery.c normal armv6 objective-c com.apple.compilers.llvm.clang.1_0.compiler
        CompileC build/ChipmunkPro.build/Release-iphoneos/ObjectiveChipmunk.build/Objects-normal/armv6/ChipmunkSpace.o Objective-Chipmunk/ChipmunkSpace.m normal armv6 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(3 failures)
What am I missing here?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Building Static Library - Errors

Post by slembcke »

The armv6 compiler (iPhone 3G and lower) in Clang 3.1 appears to have terrible bugs in it. The C compiler outputs assembly code with instructions that don't exist. Disable armv6 compilation in the Xcode target settings if you want to use Clang 3.1.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
HeshamAmiri
Posts: 6
Joined: Sat Apr 28, 2012 10:33 am
Contact:

Re: Building Static Library - Errors

Post by HeshamAmiri »

Thanks , that seemed to do the trick.

One more question:

By looking at the output directories, if I wanted to use objective-chipmunk I would only need to import that directory into the project as it seems that it includes everything I need. Correct?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Building Static Library - Errors

Post by slembcke »

If you want to include the source? It's a little more complicated. You'd need both the Chipmunk src/ and include/ directories as well as the Objective-Chipmunk/ directory from Chipmunk Pro (I'd assume you want the fast vectorized solver too in HastySpace/).

Really, I'd just recommend grabbing the ChipmunkPro-iPhone/ directory built by the iphonestatic.command script. That has everything you need. Once it's linked, the size of the lib is not very big. I haven't actually checked in a while, but I think it's like 100-200 KB.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
HeshamAmiri
Posts: 6
Joined: Sat Apr 28, 2012 10:33 am
Contact:

Re: Building Static Library - Errors

Post by HeshamAmiri »

So I dragged the ChipmunkPro-iPhone directory into my project, however when I compile for the simulator I get the following errors:

Code: Select all

Undefined symbols for architecture i386:
  "_CGImageSourceCreateWithURL", referenced from:
      +[ChipmunkImageSampler loadImage:] in libChipmunkPro-iPhone.a(ChipmunkImageSampler.o)
  "_CGImageSourceCreateImageAtIndex", referenced from:
      +[ChipmunkImageSampler loadImage:] in libChipmunkPro-iPhone.a(ChipmunkImageSampler.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When I compile for a devise I get the following:

Code: Select all

Undefined symbols for architecture armv7:
  "_CGImageSourceCreateImageAtIndex", referenced from:
      +[ChipmunkImageSampler loadImage:] in libChipmunkPro-iPhone.a(ChipmunkImageSampler.o)
  "_CGImageSourceCreateWithURL", referenced from:
      +[ChipmunkImageSampler loadImage:] in libChipmunkPro-iPhone.a(ChipmunkImageSampler.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
HeshamAmiri
Posts: 6
Joined: Sat Apr 28, 2012 10:33 am
Contact:

Re: Building Static Library - Errors

Post by HeshamAmiri »

never mind, I needed to link the imageIO library
NexcraSW
Posts: 1
Joined: Sun Oct 14, 2012 2:32 am
Contact:

Re: Building Static Library - Errors

Post by NexcraSW »

HeshamAmiri wrote:never mind, I needed to link the imageIO library
Thanks! I was having the same problem and that did the trick.
Setup was XCode 4.5, iOS6, Cocos2D v2.1b, Objective Chipmunk 2.1.1
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests