Can't modify the libObjectiveChipmunk-iPhone static library

Official forum for the Chipmunk2D Physics Library.
Post Reply
fiftysixty
Posts: 3
Joined: Wed Sep 28, 2011 3:17 am
Contact:

Can't modify the libObjectiveChipmunk-iPhone static library

Post by fiftysixty »

I've been now banging my head against the wall for the whole day. I got the pro version of the Objective Chipmunk, and the problems started when I opened the included Xcode project and tried to run it. I got error messages saying the chipmunk/chipmunk.h file couldn't be found. No problem, I changed the imports to just chipmunk.h and that solved that, but then I got a number of other similar errors with constraints/util.h. If I do the same thing there, change the imports to just util.h everything seems to work ok.

So, then I needed to make a slight change to the ChipmunkMultiGrab, basically I just added one method. Then I run the iphonestatic.command from the terminal and everything seemed to work. I then dragged the newly created Objective-Chipmunk-src/Objective-Chipmunk-iPhone into my Xcode project and used the method I added. The project compiles fine, but crashes at runtime due to NSInvalidArgumentException: unrecognized selector sent to instance. So why is the new method not present there? I've checked and double checked everything, and I can't understand what I'm missing. Any help would be appreciated so that I won't waste another day with this.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Can't modify the libObjectiveChipmunk-iPhone static libr

Post by slembcke »

What version are you using? I doubled checked the paths in the 6.0.2 project and didn't see anything amiss:
http://chipmunk-physics.net/release/chipmunkPro/

You should not have to change the paths for it to build, and doing so will break things. Also, make sure to delete the DerivedData, build and objective-chipmunk-iphone directories for an extra clean build and double check the log for any errors. If your method isn't getting included, it's almost certainly because the lib didn't actually get rebuilt.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
fiftysixty
Posts: 3
Joined: Wed Sep 28, 2011 3:17 am
Contact:

Re: Can't modify the libObjectiveChipmunk-iPhone static libr

Post by fiftysixty »

Thanks for your reply, I finally was able to solve the issues I had.

First, the issue with import paths was caused by a space in my projects pathname. Xcode expands $(SRC_ROOT) as is, and the header search paths a space separated so this caused an issue. Easy to fix, I just made sure each of my search paths is enclosed in quotation marks.

The second problem had also something to do with the search paths: this time I had an old search path referring to the trial version of the static library, and it was searched first so that's why the app was linked against the wrong, old library version. Now everything is working smoothly :)
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 5 guests