Build cocos2d-x v3.2rc0 development environment in win7 (For Android), win7cocos2d-x

Source: Internet
Author: User

Build cocos2d-x v3.2rc0 development environment in win7 (For Android), win7cocos2d-x

Cocos2d-x is currently more popular game engine, for most game developers love,

Therefore, the purpose of this article is to teach new users how to build a cocos2dx development environment under win7,

As of this article, the latest version of cocos2dx is v3.2rc0.

The environment already contains the VS2012/VS2013 integrated tool (this IDE is relatively simple to download and install,

You can download and install the tool from Microsoft.

Let's start our journey to build a game environment...


First, the following tools are required to establish the development environment:

1. Visual Studio 2012/2013 (Microsoft IDE development tool)

2. Cocos2d-x v3.2rc0 (game development engine)

3. java jdk (JAVA Development Kit)

4. python tool (for script compilation)

5. ADT package (including Android SDK components and an Eclipse IDE version with built-in ADT (Android developer tool)

6. Package Android NDK (so and java applications together into apk)


First download the cocos2d-x v3.2rc0 version to the Chinese official website,

Transport: http://cocos2d-x.org/download

After the download is complete, decompress the package directly to obtain the main directory (I will decompress all the software involved in this article to G :\),

Then go to G: \ cocos2d-x-3.2rc0 \ build, open the cocos2d-win32.vc2012.sln with VS2012,


Note that the default platform tool set is v110_xp. If we use the win7 platform, change it to Visual Studio 2012 (v110 ),


Then, we change the startup Item to CppTest, and then generate the solution...


After the compilation is successful, press F5 to start the program successfully. The following figure is displayed:


Ii. install and configure JAVA JDK

Java jdk is required because we want to port it to the Android platform. We recommend that you use 64-bit JDK for windows 64bit.

Transport: http://www.oracle.com/technetwork/java/javase/downloads/index.html

After the download is complete, install it. The local path is: G: \ Java \ jdk1.8.0 _ 05


Configure user environment variables:

1. Create a user variable:

Variable name: JAVA_HOME variable value: G: \ Java \ jdk1.8.0 _ 05
Variable name: CLASSPATH variable value:.; % JAVA_HOME % \ lib; (Note the point number)


Configure system environment variables:

2. Add the following system variables:
System variable name: Path variable value:; % JAVA_HOME % \ bin

At this point, environment variable configuration is complete.


Enter java-version in the Dos window.

(START-> Run-> cmd or win + R)

If the following figure is displayed, the installation is successful:


3. Download the ADT package and configure the Android SDK Environment

The ADT package contains the IDE development tool named Eclipse and the Android SDK. the built-in ADT development tool is used

Eclipse can use the Android SDK components (equivalent to a bridge ),

Transport: http://developer.android.com/sdk/index.html

(The website may be blocked. I used the proxy server to go in smoothly)

Configure user environment variables:

Variable name: ANDROID_SDK variable value: G: \ adt-bundle-windows-x86_64-20140624 \ sdk \ platforms; G: \ adt-bundle-windows-x86_64-20140624 \ sdk \ tools; G: \ adt-bundle-windows-x86_64-20140624 \ sdk \ platform-tools;

Variable name: path variable value: % ANDROID_SDK % (if you want to add another variable, use semicolons to separate it)


Enter adb-h in the DOS window under CMD to check whether the installation is successful.


4. download and install the python Tool

The version here is python2.73,

Transport: https://www.python.org/download/releases/2.7.3/

1. Download and install python2.73.

The local path is G: \ Python27,


Configure user environment variables:

Variable name path variable value: G: \ Python27 (add a variable later, remember to separate it with semicolons)


Enter python in the DOS window in CMD, as shown in. The installation is successful:


5. Configure and install Android NDK

Download and install Android NDK first, it is recommended to use Windows 64-bit, local path: G: \ android-ndk-r9d,

Transport: http://developer.android.com/tools/sdk/ndk/index.html


Configure user environment variables:

Variable name: NDK_ROOT variable value: G: \ android-ndk-r9d

Variable name: path variable value: % NDK_ROOT % (added from the existing end, remember to separate with semicolons)


6. Create a Cocos2dx project.

Go to the G: \ cocos2d-x-3.2rc0 \ tools \ cocos2d-console \ bin directory in the DOS window under CMD,

Enter

python cocos.py new beyondTest -p com.cocos2dx.org -l cpp -d beyond

Use the cocos. py script to create a project ,:

Parameter description:

  • Test is the project name.
  • -pNext package name
  • -lThe following development language types are available: cpp, lua, and js.
  • -dDirectory to which the project is stored

Then go to the G: \ cocos2d-x-3.2rc0 \ tools \ cocos2d-console \ bin \ beyond \ beyondTest \ proj. android directory,

Input the python build_native.py pair in DOSBuild_native.pyCompile the script,


7. Test and run the Cocos2dx project on a real machine.

1. Open Eclipse and set the Android NDK path (choose Windows> Preferences> NDK)

(Note: When Eclipse is started for the first time, an instant dialog box is displayed. You must set the default workspace ).

You can select the default setting or set it as needed (I will set it to G: \ Java \ workspace ))



2. Right-click the blank area of Project Explorer and select Import...

3. Select Exiting Android Code Into WorkSpace and click Next.


4. The browsing directory is G: \ cocos2d-x-3.2rc0 \ tools \ cocos2d-console \ bin \ beyond \ beyondTest \ proj. android,

Click Finish.


5. An error occurred while importing the file because the java org. cocos2dx. lib is missing,

(Windows-> Show View-> Problems can display this interface)


6. We will overwrite the org file under the G: \ cocos2d-x-3.2rc0 \ cocos \ platform \ android \ java \ src directory

G: \ cocos2d-x-3.2rc0 \ tools \ cocos2d-console \ bin \ beyond \ beyondTest \ proj. android \ src directory,

Then re-import the beyondTest project, and then we can see that the error disappears:


Zookeeper real machine test
1. Use a USB to connect to the mobile phone with the ANDROID system, right-click the project, or select Run from the menu,
Then click Run As-> Android Application To Go To The following interface (you can see that my ANDROID version is still 2.3.4,
But it does not affect the result ^ 0 ^). After selecting it, click OK to run it successfully on the real machine.




Finally, the following code is displayed after the job is successfully run:


Vs2010 build cocos2d-x Development Environment

Hi, I used VS2012 + cocos2d-x and didn't hit you.
Installing cocos2d-x on xcode doesn't matter to you either.
Let me give you a reference.
V.youku.com/v_show/id_xndy4ndcyotq1_html

This brainless cocos2d tutorial is still good. I just read it.
Hope to help you!

How to build an android development environment for cocos2d-x in linux/ubuntu124 Environment

This android development in the linux below, to download the linux eclipse on the line, but you said the cocos2d-x I don't understand
 

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.