« Previous - Version 12/23 (diff) - Next » - Current version
Minggo Zhang, 2011-09-20 22:59


How to run HelloWorld and tests on linux

This document will describe how to run HelloWorld and tests on linux.

1. Set up environment

  • get cocos2d-x source code
    • get latest code from git, it is not stable
    • get released version, it is stable
  • install android sdk
    Refer the link to install android sdk http://developer.android.com/sdk/index.html
    Use this appoach to install jdk
    sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" 
    sudo apt-get update
    sudo apt-get install sun-java6-jdk
    
  • install cdt for eclipse to compile c/c++ codes in eclipse
    Help -> Install New Software... -> Add...

    The link of cdt is http://download.eclipse.org/tools/cdt/releases/helios.
  • install ndk
  • install needed libs
    sudo apt-get install  libgl1-mesa-dev libglfw-dev freeglut3-dev libzip-dev

    If you meet problem as me, maybe you should run the command before installing the libs
    sudo apt-get -f

2. Run with makefile

3. Run with eclipse

First, import existing projects: File -> Import...

Then select the directory of the root of cocos2d-x

4. Run on android emulator

4.1 By eclipse

4.2 By makefile

install_cdt.jpg (46.8 kB) Minggo Zhang, 2011-09-20 22:46

import_project.jpg (32.3 kB) Minggo Zhang, 2011-09-20 22:59

select_project.jpg (75.8 kB) Minggo Zhang, 2011-09-22 22:41