The process of setting up the development environment of Cocos2D-X3.6 under Ubuntu is briefly explained, hoping to be useful to everyone. 1. decompress the downloaded package and find the build Directory: Execute the install-deps-linux.sh file under the terminal. The result is similar: time may be relatively long. 2. return to the root directory of the decompressed package and execute setup. py: You can see that this execution completes the detection of the system environment and adding the required environment variables to the configuration file. The original configuration file is backed up.
The process of setting up the development environment of Cocos2D-X 3.6 in Ubuntu is briefly explained.
1. decompress the downloaded package and find the build directory:
Execute the install-deps-linux.sh file at the terminal first
The result is similar:
It may take a long time.
2. Return to the root directory of the decompressed package and execute setup. py:
It can be seen that this execution completes is to detect the system environment and add the required environment variables to the configuration file, the original configuration file will be backed up.
3. Run the command in the directory of the decompressed package.
cmake .
Note that.
(Do not care about sudo)
4. make
The Makefile generated by cmake can be used with make. Therefore, running make in the decompressed package directory will execute the build process. After the build is complete, it is similar to the following:
Don't worry about warnings, as long as there is no error.
After this is done, run the executable file in the following location
The UI is displayed:
This indicates that the general environment has been fully established.
Test the self-built project as follows:
Run the following command:
cocos new -p com.lhyz.game -l cpp -d .
Note that the last vertex represents the current directory.
This command creates a project with the default project name MyCppGame.
After the project is created, run the following command:
cocos run -s MyCppGame -p linux
-P is followed by the platform name.
It is very slow only at the first compilation. In other cases, you only need to compile a few files, which is very fast.
The result is as follows:
Run the following command on the Android device:
Run the following command:
cocos run -s MyCppGame -p android -j 4
The apk will be installed on the device at the end of this operation, so it is best to connect to the USB connection device while the device is waiting.
Running result:
Effect:
Note that it takes a long time to compile for the first time. After modification, you will not be familiar with the problem.
Analyzing cocos2d-x-Action Implementation http://www.linuxidc.com/Linux/2013-04/82436.htm
Ubuntu cocos2d-x development environment construction and configuration http://www.linuxidc.com/Linux/2013-03/81876.htm
Realization of virtual joystick multi-point touch Cocos2d-x3.2 by http://www.linuxidc.com/Linux/2014-09/106551.htm
Ubuntu 14.04 build Cocos2d-x2.2.5 Development Environment graphic explanation http://www.linuxidc.com/Linux/2014-10/108108.htm
Cocos2D-X details: Click here
Of Cocos2D-X: Click here
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-05/117846.htm