Configuration under Cocos2d 3.6 win7

Source: Internet
Author: User
Tags java jdk 8 visual studio 2010

I build the cocos2.6 development environment requires installation tools including:

1, Visual Studio 2012 (due to incompatible Win7, need to install update 4) and virtual CD-ROM daemon tool, virtual CD-ROM: http://down.52pk.com/xiazai/131.shtml

2, Cocos2d-x 3.6: http://www.cocos2d-x.org/download

3, JAVA JDK 8 is: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

4. The Android SDK is: http://developer.android.com/sdk/

5, Python 2.7.10: https://www.python.org/downloads/release/python-2710/

6. Android NDK R10: Http://dl.google.com/android/ndk/android-ndk32-r10-windows-x86_64.zip

7, ANT 1.9.5: http://ant.apache.org/bindownload.cgi

8. The Eclipse and ADT plugins are: http://www.eclipse.org/downloads/

Visual Studio 2010 and Daemon Tool

Visual Studio 2010 Download from the software resource sharing platform, the address is: ftp://10.20.18.18, after downloading the use of Daemon tool open, installation can:

After the installation is complete, continue with the VS2010.Update4.iso in the installation diagram to resolve compatibility.

cocos2d-x 3.6

Login website Http://www.cocos2d-x.org/download, you can see the download link

I chose to download the V3.6 version. After downloading, save the compressed file to the appropriate location. My position is: D:\cocos2d-x-3.6. Go to the D:\cocos2d-x-3.6\build directory:

Double-click the "Cocos2d-win32.vs2012.sln" file, and then start Visual Studio 2012 automatically. Select Helloworldscene as the startup item:

Run the program. If you compile without errors and run successfully, you will see the following screen.

Here I encountered a problem is that the system is missing msvcr120.dll files, and then I from the C:\Windows\SysWOW64 directory of my Computer to copy a Msvcr120.dll into the company's computer in the same directory can solve the problem.

JAVA JDK 8

Download Java JDK8 after entering the download URL:

Install it in the appropriate location, my location is: C:\Program files\java\jdk1.8.0_45 and C:\Program files\java\jre1.8.0_45, the following need to configure the Java system environment variables, You can refer to the website: http://jingyan.baidu.com/article/f96699bb8b38e0894e3c1bef.html. My configuration is exactly the same as him.

Android SDK

After downloading the SDK for Android, unzip the following:

Double-click SDK Manager.exe to select the package that installs Android 5.1.1:

You can finish the installation.

Python 2.7.10

Go to the download website, then download the file, the installation process is very simple, my installation path is: D:\Python27

Android NDK R10

Enter, unzip to the appropriate path after downloading, my path is: D:\android-ndk-r10

ANT 1.9.5

Go to download path, download ant 1.9.5 Extract to the appropriate path, my path is: D:\apache-ant-1.9.5

Eclipse and ADT Plugins

Click on the http://developer.android.com/sdk/index.html page to download the ADT package, which includes the necessary Android SDK components and an eclipse of the built-in ADT (Android Developer Tool) IDE version.

Download the Android SDK download after the decompression, and put it in the appropriate directory, I placed under D:\eclipse\, in this folder there will be a Eclipse.exe program, the computer on the desktop to create a shortcut to the program. You can now double-click the desktop shortcut to start Eclipse, and an instant dialog will appear asking you to set the default workspace (workspace). Select "OK" to accept the default settings.

Configuring COCOS2DX's Android development environment

After installing all the software described above, open the command line tool, go to directory D:\cocos2d-x-3.6, run setup.py, configure the environment variable Ndk_root,android_sdk_root,ant_root for cocos:

In the configuration of these variables I encountered a problem, before it is my own right button my computer-environment variables, to add environment variables without running setup.py, the result is not able to compile the Android version of the Cocos Project, the Internet search to the solution is the URL:/http Stackoverflow.com/questions/23551144/cocos2d-x-doesnt-find-android-platform

is to remove all COCOS configuration variable cocos_console_root,cocos_templates_root,ndk_root,android_sdk_root,ant_root, Re-created by running setup.py, my variable is set to:

Create a Cocos2d-x Project

Unzip the COCOS2D-X-3.2ALPHA0 compressed package you just downloaded into the folder you specified.

Go to directory D:\cocos2d-x-3.6\tools\cocos2d-console\bin\cocos.py

Open terminal Run cocos.py script Create file

python cocos.py new test -p com.coco2dx.org -l cpp -d ~/Desktop

Parameter description:

    • Test is the project name
    • -pAfter the package name
    • -lfollowed by the development of the language type, there are CPP, LUA, JS three types
    • -dThe directory after which the project is stored

compiling Android project

In the new Project test project, execute the build_native.py script under Proj.android to compile.

Wait for it to compile successfully!

Importing the Cocos2d-x jar package

Eclipse Menu file->import->android->existing Android Code into Workspace

import Android project to eclipse

Finally, you can start Eclipse and import the Android project. Here's how: right-click on "Package Explorer" and select "Import ..." and when the dialog box appears, select "Exsiting Android Project into Workspace" (Import an existing Android project into the workspace):

The project will error because there is no library file referencing Cocos2d-x

referencing the cocos2d-x library file

Right-click the project selection Properties->android pull to the bottom, Remove the error library file path, ADD select LIBCOCOS2DX

Follow the above method to import into eclipse. Set your phone to debug mode and connect it to your computer with a USB cable, run test in Eclipse, and you'll see the running HelloWorld on your phone!

Configuration under Cocos2d 3.6 win7

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.