Eclipse c ++ in ubuntu

I tried to run the following code in eclipse on ubuntu 12.04, but it keeps giving me an error. Could you tell me why this is happening? Thank.

   #include <iostream>
   using namespace std;

  int main()
  {
  cout << "Hello World!" << endl;
  return 0;
  }

The character 'std' cannot be resolved. The symbol 'cout' cannot be resolved. The symbol 'endl' cannot be resolved.

+3
source share
1 answer

This is an Eclipse Ccl parser that cannot find characters.

You can add configuration to an already created project, but it can be painful. So just create a new C ++ project:

File> New> C ++ Project

Then:

, , " > " (, , "Makefile Project > Empty Project" ) , Linux GCC Toolchains. , ++ . "", ++ .

, Project Properties > C/++ General > Paths and Symbols > Includes > GNU ++.

+6

All Articles