cocos2dx-3.6 version simple new, compile, run engineering operations

Source: Internet
Author: User

Before the earliest contact cocos2dx is 2.1.2 version, because later work requirements, began to use quick to do project development will not touch the version of-X, local download 3.6 version of the project code, here to clean up the project under the 3.6 version of the initial process (VS2012)

1, enter the file D:\Cocos2dx\cocos2d-x-3.6 root directory, click setup.py will automatically configure the required environment variables, follow the prompts to download the corresponding non-installed development tools (sdk,ndk,ant, etc.) and configure the corresponding environment variables.

2, all environment configuration is complete, start new project:

Cocos New Project (project name)-P Com.demo.demo (package name)-L CPP (language: C++/LUA/JS)-D D:\workspace (corresponding to the generated project file).

D:\Cocos2dx\cocos2d-x-3.6\tools\cocos2d-console\bin. Configure the above path into the PATH environment variable to enter the command line through CMD to create the project (subsequent use of Cocos related commands).

(through the command line: Cocos New--h View the complete set of cmd command operations;)

3, the corresponding project files will be generated in the specified directory after execution.

4, compile the new project (Win32).

The first way: You can click on the directory: D:\workspace\GoodDay\proj.win32\.sln suffix file import vs manually compile, select the project, right-click Debug, select Start a new real column to compile. The first compilation time may be a bit long.
Problems during the compilation process:

(1)

Download the MSVCR120.dll file online and place it in the C:\Windows\SysWOW64 directory under "64-bit" (C:\Windows\System32 "32-bit").

The second way:

How to use the command line: Cocos run-p Win32, this requires a higher version of VS (vs2013 above), because 2012 compile time has been error:

Try to change in the environment variables: progra~ and add "" are not, online has said upgrade after the high version can be normal, no experiment, with or 2012.

Everything is normal. The compile-and-run output is a simple Cocos instance with: Hello world.

5, compile the project (Android version).

The first way: the command line (with configuration Cocos Console environment) runs directly: Cocos run-p Android --ap 14 (14 for API level, modified as appropriate)

At this point you will encounter a situation:

The 2.x version can modify one of the paths in the Python file.

Modify the Cocos2dx folder
.. \tools\cocos2d-console\plugins\project_compile
Build_android.py in the
Command = "%s clean-f%s-dsdk.dir=%s"% (Self._convert_path_to_cmd (Ant_path), Buildfile_path, self._convert_path_to_ CMD (sdk_root))
Change into
Command = "%s clean%s-f%s"% (Self._convert_path_to_cmd (Ant_path), Build_mode, Buildfile_path,sdk_root)

3.x version to upgrade the Python version, I was upgraded from the original 2.7 to 2.7.9, and then the error passed.

The second way: enter the D:\workspace\GoodDay\proj.android directory to click on the build_native.py file can also complete the Android project corresponding to editable project generation.

What's left is a series of actions to pack the APK in eclipse ...

cocos2dx-3.6 version simple new, compile, run engineering operations

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.