Cocos2dx for android in eclipse


#1

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


#2

Check out our YouTube channel which maybe of some help

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


#3

Hello Friend;

Now I am getting this error

“./build_native.sh: 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.


#4

The build_native.sh 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).


#5

Hi,

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.


#6

@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.

:;qst

Eclipse also shows me

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


#7

@GiZmo

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


#8

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


#9

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