what's wrong with my ndk?

what's wrong with my ndk?
0.0 0


When i complie the testDemo with NDK this problem always occurs:

/cygdrive/d/android-ndk-r5-crystax /cygdrive/d/cocos2dx/tests/test.android
make: Entering directory `/cygdrive/d/cocos2dx/tests/test.android’
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi-v7a/gdbserver
Gdbsetup : libs/armeabi-v7a/gdb.setup
Install : libbox2d.so => libs/armeabi/libbox2d.so
Install : libchipmunk.so => libs/armeabi/libchipmunk.so
SharedLibrary : libcocos2d.so
D:/android-ndk-r5-crystax/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/…/lib/gcc/arm-linux-androideabi/4.4.3/…/…/…/…/arm-linux-androideabi/bin/ld.exe: cannot find -lpng
collect2: ld returned 1 exit status
make: * [/cygdrive/d/cocos2dx/tests/test.android/obj/local/armeabi/libcocos2d.so] Error 1
make: Leaving directory `/cygdrive/d/cocos2dx/tests/test.android’

plus: i ’ve done all the changes according to the ◦“How to run test cases on android-ndk” document


Sorry, it’s my mistake at the last weekend. You must using the edge version from github.
Please modify the cocos2dx/android.mk, drag to read the end of this file. My fault is make ndk-r5 as the default config here. Change to

#it is used for ndk-r4
LOCAL_LDLIBS := -L$(LOCAL_PATH)/platform/third_party/android/libraries \
                -lGLESv1_CM -llog -lz \
                -lpng \
                -lxml2 \
                -ljpeg \

# it is used for ndk-r5    
# because the new Windows toolchain doesn't support Cygwin's drive
# mapping (i.e /cygdrive/c/ instead of C:/)  
# LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/platform/third_party/android/libraries) \
#                 -lGLESv1_CM -llog -lz \
#                 -lpng \
#                 -lxml2 \
#                 -ljpeg \
#                 -lskia

And then, you can compile it successfully on ndk r4 crystax version.
A better choice is to use our stable version, 0.8.1


Walzer, can i ask, is there any advantages in using crystax ndk over official ndk r5?


Because official ndk doesn’t support stl until ndk-r5. And ndk r4 crystax can support stl.


yep, ndk r5 integrated stlport offcially


Sinc r5 have stl support, why you still wrote about crystax in wiki and makefiles? I think this ambiguity can confuse someone :slight_smile:


The settings for R4 work perfectly out of the box with the MingW patch, please don’t get rid of ’em :slight_smile:
(the patch makes it easy to use the NDK without Cygwin / MSys - see http://code.google.com/p/mingw-and-ndk/ )