c++codeblocks

CodeLite does not recognize any c++ code


I have just downloaded Code::Blocks on my new PC and written my hello world. My code is:

#include <iostream>
using namespace std;

int main()
{
cout << "hello world!";
return 0;
}

My text does not get highlighted and when I tried to build and run the program this appeared in the terminal:

                      sh: 1: /directory/I/saved/in/helloworld: Permission denied

                      process returned 126 (0x7E)  execution time : 0.002 s
                      Press Enter to continue.

My compiler is gcc and I had the same problem in CodeLite. How can I fix it?


Solution

  • Just to sum it up: All I had to do was add an extension (in my case ".cpp") to my file, so it would be executable.