So I just recently installed Linux after using Windows for my whole life. I also just installed the C++ IDE named code::blocks using the following command in the terminal:
sudo apt-get install codeblocksNow whenever I try to run some source code I get this error
sh:1 /home/daniel/Desktop/Hey: Permission DeniedAny help/solution?
21 Answer
The normal behaviour of CodeBlocks when working on a single file (as opposed to a project) is to use the name of the file without any extension as the name of the compiled executable. So hello.cpp will produce a binary named hello. CodeBlocks checks the timestamps of the files to see whether compilation is needed. This breaks when the file doesn't have an extension: a source file named hello would have a binary file named hello from CodeBlocks' point-of-view. So timestamp checking fails, since it is comparing the file to itself. Hence CodeBlocks doesn't compile the code, and instead tries to run it directly, where it fails because the source file is not an executable. (This won't be a problem for executable source code like shell scripts.)
So always save C/C++ source code with an appropriate extension when using CodeBlocks (and in general, as well).
3