I am using ubuntu 12.04. I have eclipse juno. I wrote test.cpp :

#include <iostream>
using namespace std;

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

I enter to the terminal and I succeeded to run it. The same file in eclipse I was also able to run but eclipse always warn about errors regarding the lines (red errors).

Why is it happening ? How can I fix it ? Why is it tells me : cout can not be resolved


You must have not included some include directories required to correctly parse iostream.

  • Right Click on the project name.
  • Select Index > Search For Unresolved Includes.

    It will give you the list of unresolved includes which you can search in /usr/include and add the containing directories to C++ Include Paths and Symbols in Project Properties.

    On my computer, I have the following directories included:

    enter image description here

  • Rebuild the index (Index -> Rebuild) after adding include directories.

Source: https://stackoverflow.com/a/10804034/1626345

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.