And it is different from a project which ported with Qt framework, my template use linux native code.I am using the 2.0.4 version,
and it looks easy to update to a newer one.
It uses .qrc, which is useles without Qt port and causes compile error on my system
I’ve managed to write all-in-one `**.pri` file for cocos2d-x a few days ago, and going to make pull request to cocos2d-x. It supports cocos2d build on demand using Linux Makefile.
** Replace `COCOS2D_ROOT = $$system(echo $COCOS2D_ROOT)` with `isEmpty(COCOS2D_ROOT):COCOS2D_ROOT = $$system(echo $COCOS2D_ROOT)`: in this case user can also pass variable to qmake, as in attachment.
I’ve created pull request which adds file cocos2dx.pri, that contains everything necessary to setup project. It also automatically builds required libraries using makefiles.
You template gave me some new ideas for cocos2dx.pri, thanks for that. And I’m curious, what the reason to link application with static libraries from cocos2d-x distribution? AFAIK distributions have strict policy for that: app should use system library for security reasons, so system CURL should be used instead of precompiled.
I’ve created pull request which adds file cocos2dx.pri, that contains everything necessary to setup project. It also automatically builds required libraries using makefiles.
> https://github.com/cocos2d/cocos2d-x/pull/2703
>
You template gave me some new ideas for cocos2dx.pri, thanks for that. And I’m curious, what the reason to link application with static libraries from cocos2d-x distribution? AFAIK distributions have strict policy for that: app should use system library for security reasons, so system CURL should be used instead of precompiled.
I’m new with qtcreator. I’ve tried your way. It compiles fine. But I have problem with resources. I’m building project outside of cocos2d_root. I’m adding resource to project in assets folder, say assets/test.png, then in my .pro
But I have an error: cocos2d-x debug info [Get data from file(test.png) failed!]
(running and compiling for linux)
What is the proper way to add a resource to project and use it ?
You should set custom resource path in your code - look at CCFileUtils::setResourceDirectory(), or place resources in …/…/…/Resources folder (relative to directory where executable placed) - cocos2d-x uses this path by default.
I’ve created pull request which adds file cocos2dx.pri, that contains everything necessary to setup project. It also automatically builds required libraries using makefiles.
> https://github.com/cocos2d/cocos2d-x/pull/2703
>
You template gave me some new ideas for cocos2dx.pri, thanks for that. And I’m curious, what the reason to link application with static libraries from cocos2d-x distribution? AFAIK distributions have strict policy for that: app should use system library for security reasons, so system CURL should be used instead of precompiled.
When I tried to compiled this template at the first time, I got some link errors for the reason of different versions of some external libs. In order to be lazy to linked with static libs.
Thank you for your reflections of passion, and you make me a happy day !