6

enter image description here

Why do I keep getting this error?

>> gcc a.out
>> ./a.out
bash: ./a.out: Permission denied

I even tried this

>> chmod +x a.out

But still I keep getting the error. I have installed clang and termux-setup-storage package. My files are in main memory (not on sd card).

Termux has only problem executing a.out file. If I make any error in C program it fails to compile the a.c file

Kangkan Lahkar
  • 267
  • 5
  • 16

3 Answers3

6

You can't execute executable in internel storage because that's mount with noexec in android. Move that binary somewhere in termux home directory or $PREFIX.

Krishna Kanhaiya
  • 428
  • 3
  • 10
  • `cat /proc/mounts | grep storage/emulated | grep noexec`, and there are lots of [symbinks](https://stackoverflow.com/questions/61700922/how-does-the-android-system-create-the-storage-self-primary-directory). – schemacs May 18 '23 at 03:29
0

so if you need to run those file than you need to run $ ls //to see your file is here or not .if not than change directory $ mv a.out ~ $cd ~ $chmod +x a.out $./a.out

0

If you just installed termux api?

$ pkg install root-repo

Revoke termux app permission in settings.

$ termux-setup-storage

And taraa!!

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103