Update Chipmunk Pro 6 to 7 Linker error

Official forum for the Chipmunk2D Physics Library.

Update Chipmunk Pro 6 to 7 Linker error

Postby workman » Thu Feb 12, 2015 2:16 pm

Hi there,

I purchased the Chipmunk Pro version about 2 years ago and now wanted to update to Chipmunk 7 for my iPhone game, mostly because of the 64 bit support. I use the Chipmunk C-style library, not Objective Chipmunk. I cloned the repository as shown on the Chipmunk website using the command:

Code: Select all
git clone --recursive http://myLogin@chipmunk-physics.net/release/chipmunkPro/ChipmunkPro.git


I built the static library using the "iphonestatic.command" script in the root directory.
It creates the folder "ChipmunkPro-iPhone", which also contains the static library "libChipmunkPro-iPhone.a".
I updated my Chipmunk library and headers, by deleting the 6.2.1 folder from my projects lib folder and added the newly created folder instead of the old one. Then added it to the xcode project files as usual. The following excerpt from running the script seems to show, that the release build was successful. The script ended with errors, but these seem to relate to some Trial version which was not found, so I ignored them.

Code: Select all
...
=== BUILD TARGET ChipmunkStatic-iPhone OF PROJECT Chipmunk7 WITH THE DEFAULT CONFIGURATION (Release) ===

Check dependencies

=== BUILD TARGET ObjectiveChipmunk-iPhone OF PROJECT Chipmunk7 WITH THE DEFAULT CONFIGURATION (Release) ===

Check dependencies

=== BUILD TARGET ChipmunkPro-iPhone OF PROJECT ChipmunkPro WITH THE DEFAULT CONFIGURATION (Release) ===

Check dependencies

** BUILD SUCCEEDED **
...


After working through the many API changes, which I still don't know if I transformed them correctly to 7 (but thats another story), and updating all the other frameworks including Cocos2D the only error left, is the following Linker error, which I do not get fixed and need your help with:

Code: Select all
Apple Mach-O Linker Error

Undefined symbols for architecture arm64:
  "_cpPolyShapeNewRaw", referenced from:
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

and also

  "_cpPolyShapeNewRaw", referenced from:

ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)


I am currently building for arm64, armv7 and armv7s. The same problem if just building for armv7 and armv7s (only of course the errors for arm64 are not in it).

The function "cpPolyShapeNewRaw" is what I put on place of my previous "cpPolyShapeNew" functions.
I'm not sure why the linker breaks. The documentation states, that the created chipmunk folders have to be dropped to the xcode project, which also worked easy in previous update processes.
I deleted and rebuilt the Chipmunk library.
I cleaned the project and rebuilt.
I removed the library, which led to more "Undefined symbols" errors (as expected).
I also built the Chipmunk 7 Open Source Version, but when adding the library, it threw errors because of missing Hasty Space. I wondered, because I read about Hasty Space support for the Open Source version as well.
I put in the library from the folder "build/Release-iphoneos/libChipmunkPro-iPhone.a"

Nothing of that worked.

Maybe I am missing out on something, at least currently I am out of ideas what to do.
Some slembcke ChipmunkPro support would be great, so I can get my game to run again and perform the other API change updates, and it will hopefully work as it has before :)

EDIT:
Meanwhile I also had a look in libChipmunkPro-iPhone.a and I could verify that the cpPolyShapeNewRaw function is not in it, as the linker is telling.
Is there something wrong with my library file? Or is it intended this way and I should not use cpPolyShapeRaw?
Actually I was looking for a function that would fit for my previous call to cpPolyShapeNew.

Code: Select all
        cpVect verts[] = {
            cpv( -(self.contentSize.width/2), -(self.contentSize.height/2) ),
            cpv( -(self.contentSize.width/2),  (self.contentSize.height/2) ),
            cpv(  (self.contentSize.width/2),  (self.contentSize.height/2) ),
            cpv(  (self.contentSize.width/2), -(self.contentSize.height/2) )
        };

// This was the call using Chipmunk 6.2.1
        return cpPolyShapeNew(body, 4, verts, cpvzero);       
// This is the call using Chipmunk 7 (which I could not verify for correct behavior yet).
        return cpPolyShapeNewRaw(body, 4, verts, 0.0);


So maybe another way of creating my PolyShape could be a solution to my problem as well.

Thanks in advance!
I really appreciate your help!
workman
 
Posts: 4
Joined: Thu Feb 12, 2015 1:10 pm

Re: Update Chipmunk Pro 6 to 7 Linker error

Postby workman » Fri Feb 13, 2015 6:40 pm

Ok, I have overcome the issue by using cpPolyShapeNew with the identity matrix (cpTransformIdentity) instead of cpPolyShapeNewRaw.
workman
 
Posts: 4
Joined: Thu Feb 12, 2015 1:10 pm


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 2 guests

cron