WIN8 Configuring the Cocos2d-x environment and porting to the Android platform

Source: Internet
Author: User

Hello everybody, study today under WIN8 Configuration cocos2d-x development environment, now share it, if there is inaccurate place, please point out, thank you!

Required Software:

vs2012

ADT Bundle (integrated with Eclipse and SDK)

Ant

Ndk

Source Code of Cocos2d-x

Python

First install vs2012, install Python after installation, install Python and add Python directories into environment variables, such as:

In this case, the Python environment variable is configured so that you can execute the python command below the command line to see if it is successful:

After installation, download Cocos2d-x source, enter the directory below to see the following files:, open the command line, switch to the directory below the execution of Python setup.py will be prompted to fill in the path, directly enter the line,

, after the wait is over, reopen the command line to execute Cocos, and the command lines see: it succeeds.


Then download the Android-related software,

Configure the JDK (http://blog.csdn.net/majianjie/article/details/20851593), install it, look at the directory: Add the NDK CDT ant environment variable in the environment variable (like add Python variable), and then use the Cocos new test-p com.mjj.game-l cpp-d workspace command to create a new project, open Eclipse with vs2012 compilation success, and Pro.android Imp for the project Ort in,remember not to tick that option ., when the introduction will appear an exclamation mark, this time right click on the item---"Android, the lower right corner of the red error remove, and then the project \cocos2d\cocos\2d\platform\android\java\ src directory under the Org folder copy to Proj.android\src, overwrite the original folder, this time open org-"cocos2d-x-" below will be more than a Lib folder, and then refresh the project, this time should be no error, you can compile The command line switches to the project directory and executesCocos run-p Win32 command is run with vs2012, executeCocos Compile-p Android is compiled in Android, (this time you may need to performCocos Run-pAndroid--ap 20 will succeed, as if the version of the problem), if your project has a new CPP file, you need to modifyJNI The following android.mk file, add the contents of the CPP file (remember)

Basic is these steps, if there is not thoughtful place, you can contact me, leave a message on the line. Everyone to study together. Good night!

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.