How to use binding generator to binding a subclass of cocos2d node

Binding generator is really very important to cocos2d-x jsb users. However there is very little information to tell me how to use it. I read the tutorial at http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_bind_C++_to_Javascript And I can generate some simple classes. But simple classes is not that useful when facing a real project.

I wrote a subclass of CCNode called RectClip. And I still have no idea how to generate the binding code using generator. When I simply place the samples, the generator gives me the error: can’t open cocos2d.h.

So how can I actually get this work done? I think the key is how to configure the .ini file. But I don’t know how.

Anyone who has succeed binding a class derived from cocos2d class may you please point me a way. Or just some links may help?
I’m depressed to get the answer.

Normally, it should work.
You probably need to adding flag like

cocos_headers = -I%(cocosdir)s/cocos2dx/include -I%(cocosdir)s/cocos2dx/platform -I%(cocosdir)s/cocos2dx/platform/android -I%(cocosdir)s/cocos2dx -I%(cocosdir)s/cocos2dx/kazmath/include 
cocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT

The easiest way is to refer to what has been done in ‘tools/tojs/cocos2dx.ini’. Hope this helps.

James Chen wrote:

Normally, it should work.
You probably need to adding flag like
[…]
>
The easiest way is to refer to what has been done in ‘tools/tojs/cocos2dx.ini’. Hope this helps.

Thank you.
I just add my code to cocos lib. and regenerated all of them again.
Still some tiny problems, but I can fix them, and it works.
Thank you again.