New Project - chipmunk_private.h errors

Official forum for the Chipmunk2D Physics Library.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: New Project - chipmunk_private.h errors

Post by slembcke »

To be clear, the issue is a conflict between both what the Cocos2D and Objective Chipmunk are doing. There isn't anything I can do to Objective Chipmunk alone that won't break compatibility with existing code. I need to work with Riq on getting a fix in both places. Also keep in mind that the version of Cocos2D where this is an issue is still in beta.

The workaround is a little annoying, but really it's at most a one line fix per file.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
jcmeyer5
Posts: 89
Joined: Thu Dec 15, 2011 9:18 am
Contact:

Re: New Project - chipmunk_private.h errors

Post by jcmeyer5 »

Hello again-

I just upgraded to cocos2d 2.1 rc0 and ObjectiveChipmunk 6.1.2. The errors are back. I tried running the patch again... no joy. It fails on 2 of 3 hunks. Any ideas?
Chipmunk Pro and cocos2D 2.x branch for iOS development
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: New Project - chipmunk_private.h errors

Post by slembcke »

Sorry about the delay. I'm trying to catch up on missed posts this morning. Taking a look right now.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: New Project - chipmunk_private.h errors

Post by slembcke »

Ok. I came up with a better solution to this. I'm submitting it as a patch to Cocos2D now. When enabling CC_ENABLE_CHIPMUNK_INTEGRATION, you can also set CC_CHIPMUNK_IMPORT (the patch will make this clear).

A simpler workaround than before, and less work for Riq to worry about.
Attachments
ObjectiveChipmunkIntegration.patch
(909 Bytes) Downloaded 381 times
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
airborneinf82
Posts: 39
Joined: Sat Feb 23, 2013 1:03 pm
Contact:

Re: New Project - chipmunk_private.h errors

Post by airborneinf82 »

I've downloaded this, although the previous work around wasn't all that big of a deal. How do you install this patch?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: New Project - chipmunk_private.h errors

Post by slembcke »

Buried earlier in the thread:
... cd to wherever the cocos2d directory in your project is (should be in a directory named lib from the templates) and type "patch -p1 -i /path/to/the/patch/file"
The patch file is so short this time though that if you can't get the patch command to work on the first try, just open the patch in a text editor and copy/paste it into the Cocos2D code. There are only two spots that need to be changed.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
airborneinf82
Posts: 39
Joined: Sat Feb 23, 2013 1:03 pm
Contact:

Re: New Project - chipmunk_private.h errors

Post by airborneinf82 »

slembcke wrote:Buried earlier in the thread:
... cd to wherever the cocos2d directory in your project is (should be in a directory named lib from the templates) and type "patch -p1 -i /path/to/the/patch/file"
The patch file is so short this time though that if you can't get the patch command to work on the first try, just open the patch in a text editor and copy/paste it into the Cocos2D code. There are only two spots that need to be changed.
OK looked it over and basically you are enabling the chipmunk integration in the ccConfig.h and adding the CC_CHIPMUNK_IMPORT definition for Objective Chipmunk, then in the cocos2d.h you are including the Obj-Chipmunk import there correct?

So then now anytime I import cocos2.h then I will no longer need to import the ObjectiveChipmunk.h, only if I need it and I'm not already importing the cocos2d files right?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: New Project - chipmunk_private.h errors

Post by slembcke »

Correct. Objective-Chipmunk.h will be imported everywhere cocos2d.h is.

Also, Riq just already merged the pull request. \o/ Should be out in the next release of Cocos2D then.
https://github.com/cocos2d/cocos2d-iphone/pull/293
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: Heise IT-Markt [Crawler] and 17 guests