Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: san_zoulapi on October 23, 2009, 08:13:20 pm
-
Hello I'm new to ubuntu (and linux generaly) and am presently trying to use code::blocks on Uuntu 9.04 for simple school projects on c++. I installed the package without getting any errors , created a new empty file and typed a simple hello world program:
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
After clicking on build --> compile (and setting the text file executable manualy-did not find other way of rendering it possible to execute ) , and then Run , I get the following message :
/home/username/filename:2:using:not found
/home/username/filename: 4 : Syntax error: "(" unexpected
Press ENTER to continue.
The same error apears every time i try to compile/run other sources that work on windows dev for example. Any help? Thx
-
Do you have a compiler? gcc, g++?
-
Yes i have them installed and working. I tried manually compiling the text file using gcc via the terminal (after adding a .cpp extension to it) and it worked fine.
-
Have you saved that new file with proper C/C++ extension before compilation?
-
It worked.....I thought the IDE would set the .cpp extension itself before compiling and i didnt think of it. Thx a lot