Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

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.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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