Install cocos2d-x-3.0 on Ubuntu 12.04 LTS from scratch

Here I want to describe the process of installation of cocos2d-x on Ubuntu 12.04. I faced some problems and hope that my experience in solving them can be useful.

My step-by-step instruction is:

Step 1:

Install libsdl2-dev. This package is absent in default repositories so we need to install it manually. See [1].

$sudo add-apt-repository ppa:openmw/build
$sudo apt-get update
$sudo apt-get install libsdl2-dev

Step 2:

Install gcc and g*+ of version 4.7. That step is important because by default version of compilers is 4.6 and they do not support C11 standard that is necessary for cocos2d-x-3. Good manual of how to do that can be found here .
$sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$sudo apt-get update
$sudo apt-get install gcc-4.7 g
–4.7
$sudo update-alternatives —install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 —slave /usr/bin/g
g*+ /usr/bin/g**–4.6
$sudo update-alternatives —install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 —slave /usr/bin/g*+ g*+ /usr/bin/g**–4.7
$sudo update-alternatives —config gcc*
Then you can check version of your compilers in that way:
*$gcc —version
$g*+ —version**
h2. Step 3:
After that preparation steps we can download the latest version of cococs2d-x here and launch build script
$./make-all-linux-project.sh
Script should install all missing packages and build cocos2d-x libraries.
Now lets launch TestCpp project and check does everything work fine.
I don’t know why but during my building process CocosDenshion lib was missed so I needed to build it manually.
#launch from the CocosDenshion/proj.linux directory
$make DEBUG=1
Then in the same way build TestCpp project. But when I want to launch executable TestCpp it prints out message that my mesa lib is too old and at most version 1.5 is required. Searching for the easiest solution for that problem I found one here
$sudo add-apt-repository ppa:glasen/intel-driver
$sudo apt-get update
$sudo apt-get dist-upgrade

That way I update mesa to 2.0 version without using packages from here
h1. And now the most important thing!
During the process of dependencies installation package ubuntu-desktop was removed from my system. Consequently when you reboot instead of unity desktop handy CLI will appear! Therefore just after all this steps install ubuntu-desktop manually:
*
$sudo apt-get install ubuntu-desktop*
After all that stuff I got ready-built cocos2d-x libraries and working TestCpp project.:wink:
*Links:+
[1] : https://launchpad.net/~openmw/+archive/build
[2] : http://charette.no-ip.com:81/programming/2011-12-24_GCCv47/
[3] : https://github.com/cocos2d/cocos2d-x
[4] : https://github.com/ValveSoftware/Dota-2/issues/264
[5] : http://www.mesa3d.org/download.html

Do you have a new tutorial?
These links not working anymore.

This should work: http://www.cocos2d-x.org/wiki/How_to_run_cpp-tests_on_Linux