Not exactly programming related...
I've built the program, some basic opengl, then run it and sh: /blabla permission denied. How can I make that dissaper?
the program just makes a rotating square and I have ubuntu 9.4
just found out that even int main(){} doesn't work
I had the same problem and it appeared that my partition was mounted as noexec
cat /etc/mtab
When I configured options in /etc/fstab I wrote exec,user but it appears that "user" option by default sets up "noexec". When I changed the order of these two to user,exec everything went back to normal!
Hope it helps.
How are you compiling it? Can you post the makefile? If you run
chmod +x myPorgram
./myProgram
something changes?
Check the mountpoint to see if it's mounted as noexec by running "mount"
I use CodeBlocks on Ubuntu and have had this exact problem MANY times.
what KermiDT said is exactly the solution (if i had enough rep points, i would have voted it up)
The "user" option by default sets up "noexec".
so in /etc/fstab just add ,exec after user.
i.e. mine looks like this:
/dev/sda6 /media/DATA vfat uid=kenny,gid=kenny,users,user,exec 0 0
Though, the spacingis a bit off... but you get the idea.
Apart from the above mentioned chmod +x file, another problem might be a missing library. To check the required libraries, use ldd:
$ ldd /bin/sh
linux-vdso.so.1 => (0x00007fffb43fe000)
libc.so.6 => /lib/libc.so.6 (0x00007fc4abe11000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc4ac183000)
If one of these lines shows a missing library, you'll know what needs to be installed before you can run your program.
Another possibility is if your program is a script (shell, perl, python or other text-based program). The first line looks like:
#!/usr/bin/perl
If that file cannot be found, you'll get a permission denied error.
You also get this problem when trying to execute 32-bit apps on a 64-bit system. Execute:
a. file (executable name)
b. uname -a
and check that both are either "i386" or "amd64".
If they are not the same, have a look at this article:
Try executing the command with strace
to trace the successful system calls it makes and where it stops.
This is how you might launch it,
strace ./blabla
Do you get a "permission denied" error or something like "exec format error"? With chmod +rx
on the file you should not hit "permission denied".
You should also make sure that your username is in the video group. Check the /etc/group and make sure that your username appears on the "video" line.