stubma / cocos2dx-better

Better cocos2d-x, without modifying cocos2d-x code. Better UI controls, better utilities, better compatibility

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

One suggestion

oOEdoOo opened this issue · comments

commented

image

put these import statments into .mm file will be better~

commented

why?

When I drag the cocos2dx-better.project to my app project, and set the correct include header include path,
I got obj-c related issues.

screen shot 2013-12-09 at 6 57 40 pm

I guess it's related to this import issue. So I just commented the 2 import lines suggested by oOEdoOo.
And then still got link issues.

screen shot 2013-12-09 at 7 06 36 pm

But the TestCpp works fine.
Any steps I missed?

Thanks a lot!

commented

2013-12-09 19 19 48

change compile source as to objective-c++

But this setting cause my pure c library compiled fail.
Is the setting too aggressive?
Is there any particular reason to set this instead of default setting?
the original Cocos2d-x test cpp app doesn't need this.

Sorry that I have many questions...
BTW, is it possible just dragging few files related to the component I need instead of the whole project?
Might get more compatible?

commented

add "-x c" flag to your c source file. in build phase source list, double click a source file

commented

or create a new target for your c library

commented

Sry for reply late.
JoHuang's problem has explained why. Exactly I encounter the same problem as him.
When I dragged the project into my project, Many c library compiled fail.

So I just drag the CCRichLabel related files into my project since CCRichLabel is what I need, and commented the 2 objective-c statement in .h file. Everything works.

I think move all the objective-c code into .mm file will make this library much easier to be integrated, since no need to modify the project setting or code compile type.

commented

some macro is not easy to be refactored out as a .mm file. creating new target for your c library is best solution.