Reputation: 197
I am learning rust and cpp using Termux, I had no problem compiling then, but when I do ./main
to run the complied code, and it always say this:
bash: ./main: Permission denied
Does anyone know how to fix it?
Upvotes: 1
Views: 3215
Reputation: 111
First, make sure you've set up storage in Termux:
~$ termux-setup-storage
Then, open a Termux session and move main
to the home directory in Termux:
~$ mv storage/shared/main ./
Now run main
:
~$ ./main
Upvotes: 0
Reputation: 1
If you try to execute the binary file in /storage/emulated/0/
termux doesn't have permissions to execute but you can compile in that directory .
In order to execute, simply copy the file to ~/
by executing the command in termux cp <your file> ~/
and then you can execute it.
Upvotes: -1