views:

87

answers:

2

So I'm trying to get this program to run, but code blocks throws me this error when I try to run it.

sh: : Permission Denied.

I'm pretty much 100% noob, so links to figure out how to fix it or educational stuff on the issue would be great for learning I think, but any ideas would be helpful really. :)

+1  A: 

Not sure what OS you're using.. but if it's Ubuntu, I use CodeBlocks on Ubuntu and have had this exact problem MANY times.

The "user" option (in etc/fstab) 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.

This may be a bit tough if you're new to linux. So google about the fstab file. Also, make back up before you try to edit anything (sudo cp /etc/fstab /etc/fstab.backup)

sudo gedit /etc/fstab will open up the fstab file so you can see if the filesystem has exec in it

KennyCason
So I looked into it, I don't have this line you're talking about uid=kenny,gid=kenny,users,user,exec 0 0 On the articles i read about it, all of theirs look more like mine, Which is like this proc /proc proc nodev,noexec,nosuid 0 0I found the noexec you said, but it was followed with something different and I want to make sure this is correct line before I edit it. Also, It didn't have many of the entries you listed such as users, user stuff like that.
Samuraisoulification
Also as stated above it was Ubuntu 10.04
Samuraisoulification
copy yours exactly as is. if its `, noexec 0 0` just change it to `exec 0 0`
KennyCason
I got proc /proc proc nodev,noexec,nosuid 0 0So I guess the big thing is that I got nosuid after mine?
Samuraisoulification
I really don't know. But back up your fstab file (like i said above) and change noexec to exec. Save the file, and restart.
KennyCason
Oh and if we break it i'll give you my IM info and we'll fix it :)
KennyCason
It didn't break, but it also didn't fix the problem, same problem as before.
Samuraisoulification
yeah.. i'm not surprised as i have the same settings as you. for mounting the primary partition.. but that was what did the trick for me on other partitions that I tried executing code from..
KennyCason
so what happens if you just type `g++ main.cpp` then `./a.out`. does the`./a.out` error? (i'm assuming your just trying to get one simple file, like "main.cpp" running)
KennyCason
Then the only thing i can guess is that you set your project up wrong. create a new project(Console Application) then press F9 and tell me what happens.
KennyCason
+1  A: 

Correctly set up a project in code::blocks. (I will walk you through setting up a simple Console Application)

Frist Select "Console Application"

Then Select C or C++

Then Set your project Title and location

And then select the default compiler (GNU GCC Compiler)

Finally some template "hello world" code should appear, press F9 to compile and run.

For other future examples Just check out the Code::Blocks User manual: http://www.codeblocks.org/user-manual or Google

note This came from our conversation where we discovered he misc-onfigured Code::Blocks

KennyCason