#### Archived

This topic is now archived and is closed to further replies.

# issue with <string>

This topic is 5094 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Well as my message states, I am having an issue and I have no freaking clue as what to do to fix it. I have this in the code. #include <string> class CelistialBase { public: CelistialBase(void); CelistialBase(string inName); // <-- line 10 ... ... ... private: string mName; // <-- line 20 }; and I am recieving these errors: CelistialBase.h(10) : error C2629: unexpected ''CelistialBase ('' CelistialBase.h(10) : error C2238: unexpected token(s) preceding '';'' CelistialBase.h(20) : error C2146: syntax error : missing '';'' before identifier ''mName'' Any thought on some funkey mojo I have to do to make it work in vc7? Thanks!

##### Share on other sites
#include <string>class CelistialBase{public:CelistialBase(void);CelistialBase(std::string inName); // <-- line 10.........private:std::string mName; // <-- line 20};

##### Share on other sites
as the AP pointed out, you have to use the full identifier for the string (it is in the STD namespace).

so, you can either use "std::string" instead of just "string", or put a "using std::string;" at the top of your code.