I've just installed Eclipse and the CDT (C++) plugin, and I'm having the strangest problem.
From a fresh C++ Project, the automatically generated "Hello World!" program works just fine. However, upon creating a new C++ Class in the very same project, namespace std is not recognized. I invoke the namespace with the same syntax in both files, but the compiler is throwing this error -
"error: use of undeclared identifier 'std'"
I've restarted both Eclipse and my computer, but the problem persists. So far as I can tell, the properties of both files are exactly the same. I suspected this had something to do with the tool chain, but it is the same in both of the files. I really can't find any difference between the two files, other than their size and date created.
Your program probably didn't #include
any headers that define the namespace std
. Please add the appropriate #include
files that define the std
namespace.