Configuration under Cocos2d 2.2.6 Win7

Source: Internet
Author: User

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. The Eclipse and ADT plugins are: http://www.eclipse.org/downloads/

8, Cygwin 2.738

Visual Studio 2012 and Daemon Tool

Visual Studio 2012 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 VS2012.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 V2.2.6 version. After downloading, save the compressed file to the appropriate location. My position is: D:\cocos2d-x-2.2.6. Go to the D:\cocos2d-x-2.2.6\build directory:

Double-click the "Cocos2d-win32.vs2012.sln" file, and then start Visual Studio 2012 automatically. Select Testcpp 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 installing Android into the website http://developer.android.com/sdk/index.html, you can install Android Studio, which will bring your own Android SDK:

You can also choose to install only the Android SDK, the same site dragged down:

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

Cygwin2.738

After downloading to the appropriate path, my path is: D:\XGSDK\cygwin2.738, there is a installation guide, follow the guide to install, I copy the content of the guide.

Installation Guide:

Double-click the Run Cyg_win_setup.exe Setup program. Click "Next" to the interface, select "Install from Local diretory"

Continue to "next", such as, fill in the installation path:

Then "Next", will choose the directory of the installation package, generally do not fill in, the default decompression is currently the directory of the installation package, if not, please manually switch to the extracted directory

"Next", select the plug-in to install, since this installation package is a custom package that has been specifically designed for the Android NDK , so select the "allφinsatll , notice that you click the icon to make it by the Default "Convert to" Install "

"Next", start the installation, after the installation is complete, the following interface, there are two options, namely "Create Desktop Shortcut", "Add Shortcut to Start Menu", Recommended all selected, click "Finish".

Cygwin shortcuts can be found on the desktop , double-click to open, such as:

Now add the Cygwin Bin folder to the system path path. This machine also adds the Android platform tool behind the system path. The PATH environment variable for this machine is as follows: D:\cygwin\bin;d:\android-sdk\tools;d:\android-sdk\platform-tools;

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. Then eclipse needs to configure the Android SDK path, the menu bar window->preference:

Create a project

Open it.. \cocos2d-x-2.2.6\tools\project-creator folder, locate the create_project.py file as shown below.

Copy the path where the create_project.py file is located, and in the CMD console, enter the following command in turn:

Enter the command in the box Python create_project.py (You can skip this step when you are familiar with it), the following message will appear.

Information gives you a way to create a project, in the line drawing section:
PROJECT_NAME represents the project name, which can be customized.
Package_name represents your package name.
Programing_language represents the development language of the project you are creating, which can be Cpp,lua and JavaScript.

Follow the prompts to create the project. Enter command: Python create_project.py -project myGame -package com.myCompany.MyAwesomeGame -language cpp after carriage return, the following message appears to indicate the success of the creation

To view the directory you will find a new "Projetcs" file is generated in the "cocos2d-x-2.2.6" folder, and a new "Mygame" item will appear in the "Cocos2d-x-2.2.6/projects" directory. Open the Mygame/proj.win32 folder, then the MyGame.sln solution, and click Run Project. The following interface appears and the project was created successfully:

Eclipse Import proj.android

Finally, you can start Eclipse and then import the sample Android project in the Cocos2d-x folder.

Here's how: right-click on "Package Explorer" and select "Import ...". When the dialog box appears, select "Exsiting Android Project into Workspace" (Import the existing Android projects into the workspace).

Now select C:\cocos2d-x-2.2.6\samples\Cpp\HelloCpp\proj.android as the Import folder and you will see a screen similar to the following.

You may get to the Red Line section of the "Package Explorer" error:

This is due to the lack of the cocos2d-x Android JNI Bridging library (bridge libraries). Workaround: Import another Android project with the project location "C:\cocos2d-x-2.2.6\cocos2dx\platform\android". After you import the project, the error disappears, as shown in.

Test Cocos2d-x Android NDK Environment

This time you will switch to use the terminal instead of the Windows CMD Command tool. Open the Directory "D:\XGSDK\cygwin64" and double-click the "Cygwin.bat" file. This is a terminal that will appear and you can use the Bash command to locate the Cocos2d-x Android project.

The operation is as follows:

cd /cygdrive/d/cocos2d-x-2.2.6/samples/Cpp/HelloCpp/proj.android/

Then execute the following command:

1./build_native.sh

If no errors appear, congratulations, Windows 7 platform Cocos2d-x Android development environment is already running.

(Note: You can also run Android apps through Eclipse.) Right-click on the Android project and select "Run as Android application". )

Configuration under Cocos2d 2.2.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.