Step by step instructions for cocos2d-x-3.0beta2 and Eclipse

Step by step instructions for cocos2d-x-3.0beta2 and Eclipse


Most of the instructions are found in this thread with the exception of adding build command:

  1. Create a new C++ project using

  2. Add NDK_ROOT, ANDROID_SDK_ROOT, NDK_TOOLCHAIN_VERSION as C++ build environment variables

  3. Import project ‘libcocos2dx’ and the new project into eclipse, and add ‘libcocos2dx’ as library of new project

  4. Convert the new project to C++ project by ‘Convert to a C/C++ Project’, but I found CDT Builder is not added into Builders, so I edit .project file manually to add CDT Builder. Under buildSpec, add

  1. uncheck ‘use default build command’ and change the build command in ‘C/C++ Build->Builder Settings’ to
C:/your-python-installation-dir/python ${ProjDirPath}/
  1. uncheck Syntax and Semantic Errors in C/C++ General->Code Analysis(use project settings)

  2. remove ‘Classes’, ‘cocos2dx’, ‘extensions’ and ‘scripting’ link folder

  3. goto ‘C/C++ general->Paths and Symbols->Source Location’ and add link folder ‘Classes’ and ‘cocos2dx’ to the source location

  4. goto ‘C/C++ general->Paths and Symbols->includes’ and add ${NDK_ROOT}/platforms/android-18/arch-arm/usr/include into include directories

  5. click ‘Build Project’

Tested on Windows XP


Manually adding the CDT builder was exactly what I needed. After the “Convert to C++ project” step, the CDT builder was missing. The text formatter chewed up the XML in the original post, here’s what it looks like:


I was also able to simply use


since I’m on a Mac.

Tested on Mac OSX Mavericks, Eclipse Indigo, CDT 8.0.2