c++stringheaderg++

C++ error: ‘string’ has not been declared


In my header file I'm getting the

error: ‘string’ has not been declared

error but at the top of the file I have #include <string>, so how can I be getting this error?


Solution

  • string resides in the std namespace, you have to use std::string or introduce it into the scope via using directives or using declarations.