Ubuntu 14.04 build Cocos2d-x2.2.5 Development Environment graphic explanation
Ubuntu 14.04 build Cocos2d-x2.2.5 Development Environment graphic explanation
1. Download and decompress
Http://www.cocos2d-x.org/download
After downloading, decompress the package and you will get a directory cocos2d-x-2.2.5.
Second compilation
1. Install Dependencies
Cd to the cocos2d-x-2.2.5 directory, run the script install-deps-linux.sh to install compilation-related dependencies
/Install-deps-linux.sh
2 compile
Run the script make-all-linux-project.sh to generate a static library for cocos2dx
/Make-all-linux-project.sh
If an error occurs:
... Extensions/CocoStudio/Reader/WidgetReader/LabelReader. cpp: 54: 9: error: 'transform' is not a member of 'std'
The solution is as follows:
Extensions/CocoStudio/Reader/WidgetReader/LabelReader. cpp
Add the following to the first line:
# Include <algorithm>
Re-execute the script make-all-linux-project.sh and then OK.
Three running examples
Cd to/cocos2d-x-2.2.5/samples/Cpp/HelloCpp/proj. linux/bin/release (or/cocos2d-x-2.2.5/samples/Cpp/HelloCpp/proj. linux/bin/debug) directory,
Run the following command:
./HelloCpp
The result is as follows:
4. Create a project
Cd to cocos2d-x-2.2.5/tools/project-creator, execute:
./Create_project.py
At this time, the screen will show the following prompts, which are very detailed and I will not explain them much again.
For example, run the following command:
./Create_project.py-project HelloWorld-package com. game. helloworld-language cpp
Create a new project HelloWorld with the package name com. game. helloworld. The language is C ++.
If the following error occurs:
UnicodeDecodeError: 'ascii 'codec can't decode byte 0xe6 in position 15: ordinal not in range (128)
The solution is as follows:
Edit it with text to open the project-creator.py script, add:
Import sys
Reload (sys)
Sys. setdefaultencoding ('utf8 ')
For example:
Then execute the above command is OK, at this time under the cocos2d-x2.2.5 will be an extra projects directory, we create a new project in it.
5. Compile and run
Cd to the/cocos2d-x-2.2.5/projects/HelloWorld/proj. linux directory, execute the command:
Make
Or
./Build. sh
Two new directories bin and obj are generated in the/cocos2d-x-2.2.5/projects/HelloWorld/proj. linux directory, and the compiled executable files are in the bin directory.
Cd to the bin/release or bin/debug directory, you can see a HelloCpp.
The running effect is as follows:
Analyzing the implementation of Action in cocos2d-x
Ubuntu cocos2d-x development environment construction and Configuration
Multi-point touch of virtual joystick with Cocos2d-x3.2
Cocos2D-X details: Please click here
Cocos2D-X: Please click here