For the classmate who just started learning Cocos2d-x engine transplant Android

Source: Internet
Author: User

Just started to learn cocos2-x, but in accordance with the tutorial to the General Android development environment has been installed eclipse once again upgraded to install the CDT and the NDK took me dozens of hours, almost give up.

Blog http://blog.csdn.net/b1boy/article/details/14645277

Tell me about the process:

Download NDK plugin, NDK package, CDT plugin. The most beginning I according to the book downloaded Cocos2d-x 2.0.1, hope to unify with the book, so that later when learning to participate in the book will not encounter too many problems. After the good to meet the problem, my computer only have vs2013, and that version of the only support 2010 and 2008, I turned the project into a vs2013, when the new project found no cocos2d template, this is 2013 with that convergence a bit of a problem. Then I downloaded the cocos2d-x2.2.3 version number, and then listen to the roommate said the new edition can not use VS to create new projects, and then Baidu to see what the latest is the same thing, the original is a Python script to create a new multi-platform multiple project. OK, then download Python, because of the habit of the problem I like to download the latest software every time, downloaded and installed, environment variables are also well-equipped, Start a new 2.2.3 Project (by the way, 2.0.1 seems to be unable to use the Python method to build, because I did not find the corresponding file, I do not know if there are other methods, so I downloaded 2.2.3 version), when the implementation of the console error, syntax error, said that print how to drop ... Baidu again to know 3.0 version of the Python after the print changed to a function to write print (), no way to uninstall and download a 2.7 version number, the next is Yimapingchuan, but .... It's just a matter of building a new project, and it's hard to say that you can compile and execute on your phone.

As for how that is imported I will not say, say the key, is so many red fork how to eliminate.

1. Add Cocos2d-x-2.2.3\cocos2dx\platform\android\java to eclipse and make it easy to call later.

2. Add the 1 imported project to BuildPath.

3. Refer to http://blog.csdn.net/b1boy/article/details/14645277, which is said to be better,

Ndk_root Path is D:\AndroidSDK\android-ndk-r9d

COCOS2DX Path is D:\cocos2d-x\cocos2d-x-2.2.3

Ndk_module_path Path is d:\cocos2d-x\cocos2d-x-2.2.3;d:\cocos2d-x\cocos2d-x-2.2.3\cocos2dx\platform\third_party\ Android\prebuilt

To declare, the above Ndk_module_path I see on other blogs some people say that the one between the two paths is a colon, for example path 1: Path 2: Path 3 ... , I also changed this, did not change well, finally still use the semicolon. It turns out that semicolons are right, and don't know why they have to stress the question of using a colon, which could be a version number.

These two points are very important, see clearly the position of the picture, set up the error basically almost the same no

4. Change Android.mk to join?

$ (call Import-add-path,d:\cocos2d-x\cocos2d-x-2.2.3 )
D:\ Cocos2d-x\cocos2d-x-2.2.3\cocos2dx\platform\third_party\android\prebuilt )

There is absolutely no space in the 5.NDK path. I didn't know when I called in Eclipse, but with the command line you would find that there are no spaces in the hint path. As for the path of COCOS2DX can have spaces, I do not remember now, in order to insure everyone set the path when you do not have spaces or Chinese characters.

6. If there is a file in CPP or Java that says the header file or the package is not found, you need to include the D:\AndroidSDK\android-ndk-r9d\platforms\android-14\arch-arm\usr\include, New Folder->advanced->link ... ->finish to join in like this?

The above is my dozens of-hour summary, hey ... Finally, the first part is done.


For the classmate who just started learning Cocos2d-x engine transplant Android

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.