Code::Blocks Ubuntu problem

Apr 9, 2012 at 8:54pm
Hello!
I wrote some code and compiled it into an executable. XTerm (which opens up after the executable has been produced) printed:

sh: 1: /media/disgo/Code/c++/Practise/Games/TextBasedRPG/bin/Debug/Text Based RPG: Permission denied

Process returned 126 (0x7E) execution time : 0.004 s

I know that the code is perfectly fine (as it worked very well in Windows XP (also using Code::Blocks)). Could somebody please tell me how to sort this out?
Apr 9, 2012 at 9:00pm
You shouldn't really use XTerm for anything, so replace the default terminal (in Settings/Environment) with gnome-terminal --geometry=205x55 -x
If the problem persists: are you trying this on a partition formatted with NTFS? That file system does not support the +x bit, which must be set for a file to be executed.
Apr 9, 2012 at 9:36pm
The partition was not NTFS - it was FAT16. Copied over to my desktop to try though (which is ext4) and did the Gnome Terminal thing (don't know how it got to XTerm anyway), but nothing has changed. Would the "Shell to run commands in" have anything to do with it (that is set to "/bin/sh -c")?
Last edited on Apr 9, 2012 at 9:37pm
Apr 9, 2012 at 9:39pm
Copying alone won't change anything, you have to rebuild the executable or set the executable bit manually on the binary.
Apr 9, 2012 at 9:43pm
I have deleted all of the object files and it is now working as intended. Thanks for all of th help, Athar!
Topic archived. No new replies allowed.