Your FMAT.h requires a definition of std::string in order to complete the definition of class FMAT. In FMAT.cpp, you've done this by #include <string>
before #include "FMAT.h"
. You haven't done that in your main file.
Your attempt to forward declare string
was incorrect on two levels. First you need a fully qualified name, std::string
. Second this works only for pointers and references, not for variables of the declared type; a forward declaration doesn't give the compiler enough information about what to embed in the class you're defining.