Error in compiling HelloWorld

Dear all,
I’m using ndk5, cocos2d 0.7.1, windows 7.

I modified the .mk files according to instructions in cocos2d-x website. When running ./build_native.sh, I get the following error:

# ./build_native.sh
resources already exist
/cygdrive/d/android-ndk-r5 /cygdrive/d/cocos2d-0.99.4-x-0.7.1/HelloWorld/android

make: Entering directory `/cygdrive/d/cocos2d-0.99.4-x-0.7.1/HelloWorld/android'

Gdbserver      : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup       : libs/armeabi/gdb.setup
SharedLibrary  : libcocos2d.so
D:/android-ndk-r5/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/..
/lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld.ex
e: D:/cocos2d-0.99.4-x-0.7.1/HelloWorld/android/obj/local/armeabi/libstlport_sta
tic.a: No such file: Permission denied
collect2: ld returned 1 exit status
make: *** [/cygdrive/d/cocos2d-0.99.4-x-0.7.1/HelloWorld/android/obj/local/armea
bi/libcocos2d.so] Error 1
make: Leaving directory `/cygdrive/d/cocos2d-0.99.4-x-0.7.1/HelloWorld/android'
/cygdrive/d/cocos2d-0.99.4-x-0.7.1/HelloWorld/android

The first time I issued the command I got a longer output (as it was compiling everything from scratch) but I ended up with the same error anyway.
Any hint on how to solve this?

Thanks!

Dear all,
it’s me again (I like answering myself! :P), I’ve found the fix, I can’t speak Chinese (or whatever language it is) but you find it here: http://www.usefullcode.net/2010/12/android_ndkstl.html

Basically you just need to add the following line to your Application.mk:

STLPORT_FORCE_REBUILD := true

Hope it helps!


Marco
http://www.marco83.com/work

Thank you for you work.

Add “STLPORT_FORCE_REBUILD := true” in Application.mk will force stlport to be rebuilt everytime. It would be slow, then the other people would not be happy. I think it is a solution to add it as an comment in Application. The people who need it will uncomment it.

D:/android-ndk-r5/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/…
/lib/gcc/arm-linux-androideabi/4.4.3/…/…/…/…/arm-linux-androideabi/bin/ld.ex
e: D:/cocos2d-0.99.4-x-0.7.1/HelloWorld/android/obj/local/armeabi/libstlport_sta
tic.a: No such file: Permission denied

The error looks like the ndk does contains libstlport_static.a, so after you rebuilding it will resolve it. But why it does not contains libstlport_static.a. I think it is the key point to resolve it.

Anonymous wrote:

Dear all,
I’m using ndk5, cocos2d 0.7.1, windows 7.
>
I modified the .mk files according to instructions in cocos2d-x website. When running ./build_native.sh, I get the following error:
>
[…]
>
The first time I issued the command I got a longer output (as it was compiling everything from scratch) but I ended up with the same error anyway.
Any hint on how to solve this?
>
Thanks!

Maybe i’m late (but I can help newcomers), however it just happened to me and the problem was a bad permission of the android folder. I know that was created by the create_android_project.bat with administrator rights, but the android folder was set with strange rights. Just change rights to him and his subfolders.

Hi,Williams Piazza!you said;“…change rights to him and his subfolders”.but how to do it.maybe it is very simple problem for you.

I Fixed. Williams Piazza, I agree with you and I find the way to change rights of project folder. I just cut the project folder to another place,then uncheck Read-only. finally cut the modifed project folder to cocos2d-1.0.1-x-0.12.0 folder. After all done, build_native.sh again.