Win7 + Eclipse + NDK + CDT + cocos2d-x environment configuration

Source: Internet
Author: User

1, install Cocos2d-x 2.2.3

Download Cocos2d-x 2.2.3 engine on cocos2d website, unzip after download

2. Install Eclipse and Android SDK

Eclipse is available on its website (website address).

Android SDK in Android Developer Center Download (address).

3. Installing the JDK

Eclipse requires a Java environment to run. If the Java environment is not installed beforehand, an error will be given.

Solution to install the JDK ().

4. Installing the CDT plugin ()

This is an Eclipse plug-in to support the development of the C + + language in Eclipse.

5. Install NDK ()

This is a necessary tool for mixed compilation of C + + and Java. Make a note of the directory that was extracted after the download, as it will be used in subsequent installations.

5. Import LIBCOCOS2DX

Open Eclipse, right-->import->existing Android Code into workspace->x:\cocos2d-x-2.2.3\cocos2d-x-2.2.3\cocos2dx\ Platform\android\java

6. Import Hellocpp

Open Eclipse, right-->import->existing Android Code into workspace->x:\cocos2d-x-2.2.3\cocos2d-x-2.2.3\samples\ Cpp\cocos2d-x-2.2.3\samples\cpp\hellocpp\proj.android

7. Modify C + + Build

Hellocpp Project Right-click->properties->c/c++ build->build command:x:\android-ndk-r9d-windows-x86_64\android-ndk-r9d \ndk-build.cmd

8. New Build

Right-click on hellocpp Item->properties->build->new->location:x:\android-ndk-r9d-windows-x86_64\android-ndk-r9d\ Ndk-build.cmd->working directory:${workspace_loc:/hellocpp}->enviroment variables to Set–>new->name: Ndk_module_path->value:x:\cocos2d-x-2.2.3;d:\game\cocos2d-x-2.2.3\cocos2d-x-2.2.3\cocos2dx\platform\third_ Party\android\prebuilt

9, modify the ANDROID.MK

Add to end of file:

$ (call Import-add-path, x:\cocos2d-x-2.2.3\cocos2d-x-2.2.3)

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

$ (call import-module,cocosdenshion/android)

$ (call IMPORT-MODULE,COCOS2DX)

$ (call import-module,extensions)

10, modify the APPLICATION.MK

Add NDK path: ndk_module_path: = x:/cocos2d-x-2.2.3/cocos2d-x-2.2.3/cocos2dx/platform/third_party/android/prebuilt

11. Operation

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.