Linux Installation and Setup
Prerequisites
A supported environment. See Installation Prerequisites
Setting up Cocos2d-x
Download Cocos2d-x and unzip it. (maybe: ~/)
Install dependencies. If you are using Ubuntu/Debian, there is a shell script build/install-deps-linux.sh for you to install the dependences easily. Run the commands below, in a terminal:
> cd $cocos2dx_root/build > ./install-deps-linux.sh
Otherwise, you should install the dependencies manually. The dependencies are:
libx11-dev libxmu-dev libglu1-mesa-dev libgl2ps-dev libxi-dev g++ libzip-dev libpng12-dev libcurl4-gnutls-dev libfontconfig1-dev libsqlite3-dev libglew*-dev libssl-dev
Building Cocos2d-x
Run cmake to generate makefile:
> mkdir linux-build > cd linux-build > cmake ../..
When cmake finishes, many files & folders will be generated in coocs2dx_root/build/linux-build
Run make to compile:
> make
Everything will be generated in cocos2dx_root/build/linux-build/bin/cpp-tests/ if compiled successfully.
Run
cpp-tests
> cd bin/cpp-tests/ > ./cpp-tests
Starting a new project
Once everything above works, you can start a new project! To do this, read our document on the Cocos Command-line tool.