Cocos2dx for android in eclipse


Can someone please help me to understand how to add the cocos 2dx sample app into eclipse on a windows machine for android and I os.

any help would be great as I am very very frustrated and on the verge of leaving cocos2d…

Thanks in advance


Check out our YouTube channel which maybe of some help

Feel free to message us with any questions you may have.


Hello Friend;

Now I am getting this error

“./ line 90: ▒/cygdrive/c/android-ndk-r8b▒./ndk-build: No such fi le or directory”

Would u please help me in this.

I am just trying to run the sample project “simpleGame” from cocos2dx.


The script (which setup and launch the build of the C++ part of the Android project) can’t find ndk-build, which is the tool that actually compile C++ for Android.

The script is telling you it can’t find ndk-build. Either you didn’t download the NDK, or the PATH environment variable is not properly set.

Aside from that, NDK-r8b is old, you should use a more recent version (cocos2dx 3.X only support NDK-r9 or more recent).



The main issue that I had was ‘Symbol is not resolved’

Honestly, I could not get rid off this issue. I got this problem while I was using Box2D and CocosDenshion libraries. I tried to add to the Path and Symbols the direction of the included files and also rebuilt the Indexes. However, even if the project was successfully built, Eclipse was still giving me this error.

What really bugs me was the I was unable to install the application in the Android devise because of those silly errors. So, I decided to do a hack by just going to File->Properties->C/C++ General->Code Analysis and I disabled all the Syntax and Semantic errors. I know that this solution is not very elegant, but it works. Also, if I encounter any error the compiler will give me the message at the console windows.


@Fradow Thank you for the reply I did shift to new version of ndk-r9d

And my error “./ndk-build: No such file or directory” has been resolved. But now,

I get one error and few warnings after compilation,

I get this error - “…prebuilt/windows/bin/…/lib/gcc/arm-linux-androideabi/4.4.3/…/…/…/…/arm-linux-androideabi/bin/ld.exe: Dwarf Error: mangled line number section.


Eclipse also shows me

D:/cocos2d-x-2.2.3/cocos2d-x-2.2.3/samples/Cpp/SimpleGame/…/…/…/…/cocos2dx/kazmath/src/quaternion.c:478: warning: incompatible implicit declaration of built-in function ‘memcpy’



Hello Thanks for the reply but I tried the same thing just before I started this thread but did not work out for me


You might have a problem with Cygwin. Did you install the Devel packages?


@GiZmo Yes I did install all gcc & other pages including make packages