Win8 under the configuration of cocos2d-x environment and to android platform transplantation, win8cocos2d-x

Source: Internet
Author: User
Tags macbook

Win8 under the configuration of cocos2d-x environment and to android platform transplantation, win8cocos2d-x

Hello everyone, today I learned to configure the development environment of cocos2d-x in win8, now share it, if there is an inaccurate place, please point out, thank you!

Required Software: http://pan.baidu.com/s/1u8ulw

Vs2012

Adt Bundle (integrated with eclipse and sdk)

Ant

Ndk

Cocos2d-x source code

Python

Install vs2012 first, install python, and add the python directory to the environment variables after installing python, for example:

In this case, the environment variables of python are configured. You can run the python command below the command line to check whether the environment variables are successfully configured:

Download the source code of the cocos2d-x after installation, enter the directory to see the following file:, open the command line, switch to the directory to execute python setup. py will prompt you to enter the path, just enter,

, Wait for the end, re-open the command line to execute cocos, the command line will see: it is successful.


Then download android-related software,

Configure JDK (http://blog.csdn.net/majianjie/article/details/20851593), after installation, look at the Directory:, in the environment variables to add ndk cdt ant environment variables (similar to adding python variables ), then use cocos new test-p com. mjj. game-l cpp-d workspace command to create a new project, use vs2012 to compile successfully, open eclipse, and set the project's pro. android import, remember not to check that option. When it is introduced, an exclamation point will appear. Right-click the project and choose Properties> android, and remove the red error in the lower right corner, copy the org folder under the \ cocos2d \ cocos \ 2d \ platform \ android \ java \ src directory of this project to proj. android \ src, overwrite the original folder, this time open org-"cocos2d-x-" below will have a lib folder, and then refresh the project, this time should be no error, you can compile the command line to switch to the project directory. run the cocos run-p win32 command using vs2012 and run cocos compile-p android to compile it in android, (in this case, you may need to execute cocos run-p android -- ap 20, as if the version is incorrect.) If your project has a new cpp file, you need to modify android under jni. mk file to add the directory of the cpp file (remember)

These are the basic steps. If you have any questions, contact me and leave a message. Learn together. Good night!


How to install CDT for android configuration cocos2d-x environment?

Create an Android project named "CCTest". Youngs-MacBook-Air :~ Young40 $ cd/opt/cocos2d-2.0-x-2.0.3/Youngs-MacBook-Air: cocos2d-2.0-x-2.0.3 young40 $. create-android-project.sh use global definition of NDK_ROOT:/opt/android-ndk-r8b use global definition of ANDROID_SDK_ROOT:/opt/android-sdk-macosx Input package path. for example: org. cocos2dx. example com. young40 Now cocos2d-x supports Android 2.2 or upper version Available Android targets: ---------- id: 1 or "android-3" Name: Android 1.5 Type: Platform API level: 3 Revision: 4 Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P ABIs: armeabi ---------- id: 2 or "android-10" Name: Android 2.3.3 Type: Platform API level: 10 Revision: 2 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854 ABIs: armeabi ---------- id: 3 or "android-15" Name: Android 4.0.3 Type: Platform API level: 15 Revision: 3 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800 ABIs: armeabi-v7a, x86 ---------- id: 4 or "android-16" Name: Android 4.1 Type: Platform API level: 16 Revision: 2 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in ABIs: armeabi-v7a input target id: 2 input your project name: CCTest Created project directory:/opt/cocos2d-2.0-x-2.0.3/CCTest/proj. android Created directories/opt/cocos2d-2.0-x-2.0.3/CCTest/proj. android/src & #47 ...... remaining full text>

Cocos2d-x android environment Installation

This is a lack of cocosdx classes for android, and 2.x did not copy them.
In \ cocos2d-2.0-x-2.0.4 \ cocos2dx \ platform \ android \ java \ src \ org \ cocos2dx \ lib
Copy all files to the project. Of course, you must change the package name.

Related Article

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.