0

I am unable to build helloWorld sample to get .so to run it in eclipse. I have imported project successfully and changed variable to my root path as required. this is my build_native.sh. I am pasting the only change I made in that file

NDK_ROOT_LOCAL=/cygdrive/e/android-ndk-r8
COCOS2DX_ROOT_LOCAL=/cygdrive/e/cocos2d

And my NDK is working fine because I have executed HelloWorld sample of NDK successfully. My SDK version is 20 and NDK version is 8 and I am using cygwin above than 1.7.. I have executed the chown on my NDK directory.. But when I run the command ./build_native.sh in HelloWorld sample program for cocos2d I get this error

E:/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/../lib/gcc/arm-          linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/png.a: No such file: Permission denied
collect2: ld returned 1 exit status

and when I search for png.a in my NDK directory window can't locate that file. I am confused whether it's a permission error or File isn't there. But I have the latest NDK if file isn't there how come anyone will able to run cocos2d-x??? Need Help!!!

Waqas
  • 4,411
  • 6
  • 27
  • 31

1 Answers1

0

It seems like the permissions on built files were missing when I tried as well.

$ ls -l obj/local/armeabi/png.a
---------- 1 someuser Domain Users 912618 Jul 12 18:23 obj/local/armeabi/png.a

There is a link suggested on the forum which doesn't seem to be accessible right now.

Anyway, to fix, you can set the permission on the files.

$ cd obj/local/armeabi/
$ chmod 664 *.a
$ cd ../../..

Edit: A better fix may be to set the default permissions in /etc/fstab to

none /cygdrive cygdrive binary,noacl,posix=0,user 0 0

Following this, you should be able to run ./build_native.sh.

A command you could use to locate all files below the current directory which have no (read/write) permission available on them is find . -type f -perm 0

See this answer to set write permissions on all files below your working directory.

Consider going through a tutorial on chmod to understand the concept of permissions in linux/unix in case you're unfamiliar with them.

Community
  • 1
  • 1
PAT
  • 507
  • 5
  • 13