How to run HelloWorld and tests on linux
Version 13 (Minggo Zhang, 2011-09-20 23:48)
| 1 | 1 | Minggo Zhang | h1. How to run HelloWorld and tests on linux |
|---|---|---|---|
| 2 | 1 | Minggo Zhang | |
| 3 | 1 | Minggo Zhang | This document will describe how to run HelloWorld and tests on linux. |
| 4 | 1 | Minggo Zhang | |
| 5 | 1 | Minggo Zhang | h2. 1. Set up environment |
| 6 | 1 | Minggo Zhang | |
| 7 | 2 | Minggo Zhang | * get cocos2d-x source code |
| 8 | 9 | Minggo Zhang | ** get latest code from git, it is not stable |
| 9 | 9 | Minggo Zhang | ** get released version, it is stable |
| 10 | 9 | Minggo Zhang | * install android sdk |
| 11 | 9 | Minggo Zhang | Refer the link to install android sdk http://developer.android.com/sdk/index.html |
| 12 | 9 | Minggo Zhang | *Use this appoach to install jdk* |
| 13 | 8 | Minggo Zhang | <pre> |
| 14 | 1 | Minggo Zhang | sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" |
| 15 | 1 | Minggo Zhang | sudo apt-get update |
| 16 | 1 | Minggo Zhang | sudo apt-get install sun-java6-jdk |
| 17 | 8 | Minggo Zhang | </pre> |
| 18 | 10 | Minggo Zhang | * install cdt for eclipse to compile c/c++ codes in eclipse |
| 19 | 11 | Minggo Zhang | Help -> Install New Software... -> Add... |
| 20 | 11 | Minggo Zhang | !install_cdt.jpg! |
| 21 | 12 | Minggo Zhang | The link of cdt is http://download.eclipse.org/tools/cdt/releases/helios. |
| 22 | 9 | Minggo Zhang | * install ndk |
| 23 | 7 | Minggo Zhang | * install needed libs |
| 24 | 7 | Minggo Zhang | <pre>sudo apt-get install libgl1-mesa-dev libglfw-dev freeglut3-dev libzip-dev</pre> |
| 25 | 7 | Minggo Zhang | If you meet problem as me, maybe you should run the command before installing the libs |
| 26 | 7 | Minggo Zhang | <pre>sudo apt-get -f</pre> |
| 27 | 7 | Minggo Zhang | |
| 28 | 7 | Minggo Zhang | h2. 2. Run with makefile |
| 29 | 7 | Minggo Zhang | |
| 30 | 7 | Minggo Zhang | h2. 3. Run with eclipse |
| 31 | 12 | Minggo Zhang | |
| 32 | 12 | Minggo Zhang | First, import existing projects: File -> Import... |
| 33 | 12 | Minggo Zhang | !import_project.jpg! |
| 34 | 12 | Minggo Zhang | |
| 35 | 12 | Minggo Zhang | Then select the directory of the root of cocos2d-x |
| 36 | 12 | Minggo Zhang | !select_project.jpg! |
| 37 | 7 | Minggo Zhang | |
| 38 | 13 | Minggo Zhang | Now, you can build and run HelloWorld and tests. |
| 39 | 1 | Minggo Zhang | |
| 40 | 5 | Minggo Zhang | h2. 4. Run on android emulator |
| 41 | 2 | Minggo Zhang | |
| 42 | 2 | Minggo Zhang | h3. 4.1 By eclipse |
| 43 | 2 | Minggo Zhang | |
| 44 | 2 | Minggo Zhang | h3. 4.2 By makefile |