One suggestion
oOEdoOo opened this issue · comments
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.
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.
But the TestCpp works fine.
Any steps I missed?
Thanks a lot!
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?
add "-x c" flag to your c source file. in build phase source list, double click a source file
or create a new target for your c library
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.
some macro is not easy to be refactored out as a .mm file. creating new target for your c library is best solution.