C++: Unable to resolve identifier cout, Netbeans, Ubuntu

OtagoHarbour picture OtagoHarbour · Feb 18, 2012 · Viewed 17.4k times · Source

I am using C++ on Netbeans 7.1 on Ubuntu 11.04. For some reason, the following code results in the error message "Unable to resolve identifier cout".

#include <iostream>

using namespace std;
int main()
{
    std::cout << "Hello,world!\n";
    return 0;
}

Any help resolving this problem would be greatly appreciated.

Answer

user2216619 picture user2216619 · Jun 14, 2014

The solution for your problem is at least strange ;) Once iostream header is added, one has to reparse code. Click right on a project, go to code assistance and click to reparse project. Worked for me. I was using netbeans for mac.