Page 1 of 1

Building Static Library - Errors

Posted: Sat Apr 28, 2012 11:14 am
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?

Re: Building Static Library - Errors

Posted: Sat Apr 28, 2012 5:10 pm
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.

Re: Building Static Library - Errors

Posted: Sat Apr 28, 2012 11:38 pm
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?

Re: Building Static Library - Errors

Posted: Sun Apr 29, 2012 10:16 am
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.

Re: Building Static Library - Errors

Posted: Sat May 05, 2012 11:27 pm
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)

Re: Building Static Library - Errors

Posted: Sun May 06, 2012 12:18 am
by HeshamAmiri
never mind, I needed to link the imageIO library

Re: Building Static Library - Errors

Posted: Sun Oct 14, 2012 2:35 am
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