Giter VIP home page Giter VIP logo

Comments (8)

stubma avatar stubma commented on July 24, 2024

why?

from cocos2dx-better.

JoHuang avatar JoHuang commented on July 24, 2024

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!

from cocos2dx-better.

stubma avatar stubma commented on July 24, 2024

2013-12-09 19 19 48

change compile source as to objective-c++

from cocos2dx-better.

JoHuang avatar JoHuang commented on July 24, 2024

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?

from cocos2dx-better.

stubma avatar stubma commented on July 24, 2024

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

from cocos2dx-better.

stubma avatar stubma commented on July 24, 2024

or create a new target for your c library

from cocos2dx-better.

oOEdoOo avatar oOEdoOo commented on July 24, 2024

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.

from cocos2dx-better.

stubma avatar stubma commented on July 24, 2024

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

from cocos2dx-better.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.