Sorry, it was my bad and thank you, it worked!
I added #include <string> to my header file and replaced using namespace std with using std::string;
Should i always use using std::string in my header files?
Definitely do not ever put usingnamespace std; in header files.
Whether you want to put using std::string;
or just put std::
before every use of string is far less important, and you can just do whatever is easier for you.
using std::string; is less bad than usingnamespace std; in a header, but I would advise avoiding putting any using statements at all in headers. Otherwise, you're forcing any code that uses your header, to pull things into the global namespace, without any consideration of what problems that might cause for the code including that header.