#include<string> not working in a win32 app

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thenath24
    New Member
    • Apr 2007
    • 10

    #include<string> not working in a win32 app

    Hello all,

    I am writing a backup tool in c++ and created a project using the win32 app option.

    For some reason it will not allow me to use strings even though I have included the string class, it reports the following error;

    error C2065: 'string' : undeclared identifier

    does anyone know why this is?, and can it be fixed and if so how?

    Thanks
  • oler1s
    Recognized Expert Contributor
    • Aug 2007
    • 671

    #2
    Have you used the std:: qualifier when referring to string. Remember that C++ standard library whatever is in the std namespace. string would be one of them.

    Comment

    • Ganon11
      Recognized Expert Specialist
      • Oct 2006
      • 3651

      #3
      Have you included std::string as follows:

      [CODE=cpp]using std::string;
      // OR
      using namespace std;[/CODE]

      Comment

      • thenath24
        New Member
        • Apr 2007
        • 10

        #4
        Originally posted by Ganon11
        Have you included std::string as follows:

        [CODE=cpp]using std::string;
        // OR
        using namespace std;[/CODE]
        Thank you both thats sorted it, could have sworn I tried that before and it didn't work oh well :-)

        Comment

        Working...