Cocos2d-x in the Windows platform environment

Source: Internet
Author: User

| Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The compressed and executable files required to configure the Cocos2d-x engine under the Windows platform are as follows:

Download Link:

adt:http://tools.android-studio.org/index.php

ndk:http://wear.techbrood.com/tools/sdk/ndk/

apache:http://ant.apache.org/bindownload.cgi

cocos:http://www.cocos.com/download/

python:https://www.python.org/downloads/

The first step: after downloading some of the above prerequisites, unzip the compressed files into their respective folders, as

The second step: Create a dev_cocos2d folder under the C packing directory and put the Cocos2d-x unzip file in it

Step three: Install Python, because the new version of Cocos2d-x is going to create the project with the Phython script, and the installation process is next.

Fourth Step: Configure environment variables:

First, we will find a setup.py file under the Cocos source folder, as shown in:

Then, copy the path to it

In open cmd: such as action (win+r input cmd quick Open)

From the terminal tells us to configure the path of the ndk_root, this only need to locate the path of the Ndk file to copy to the terminal prompt, press

You can configure it by following the Enter:

Locate the android-ndk-r9d folder, copy the path, and then press ENTER for the path input terminal:

After configuration, the terminal reminder configures the path of the Android_sdk_root:

The path of the SDK is found as the path of the above configuration Ndk_root, and the same operation is performed;

After that, the path of the ant_root is configured;

Locate the path to the Apache-ant file in the bin directory

Finally, after the configuration completes, prompts restarts the terminal;

So all the environment variables have been configured successfully, we can see the path we just configured under environment variables of Windows Advanced system settings:

Although the above environment variables have been configured successfully, when we re-open CMD and prepare to create the Cocos project, we find the following:

What's the reason for this? We can see that the display on the terminal says: ' Python ' is not an internal or external command, nor is it a running program or batch file.

We enter path to view the configured paths to find a path name at the Red line:

We open this path, and in this we see that the cocos.py file is going to be executed, and we are not configuring the Python environment variable, which also appears

The cause of the above problem.

When executing cocos.py, we can see that there is no Python path in the path of the terminal, that is to say we also need to configure the path of Python;

We can configure the same as above, as well as the following method to configure the environment variables, such as:

, locate the path to the installation.

Then, mouse to find my computer, right-click into the properties, find, pop up a message box, find advanced--environment variable to find

To path Select, click Edit Add; C:\Python27 path; Remember to add a semicolon '; ' in the lower half of the English state before the path. Such as:

After that, I can create the project by using the terminal to enter Cocos in it; in fact, we can also not need to configure the Python ring

The same as the environment variable can create the project: At this point we have to enter cocos.py in the terminal to create the project, not cocos;
Below we can verify the following: (we can already use the Cocos command to create the project)

Cocos2d-x in the Windows platform environment

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.