Menu

#21 C++ STL class problem

closed
nobody
None
5
2003-01-03
2002-09-16
Jon Kuhn
No

I am using MinGW 2.0 with gcc 3.2. I keep getting the
following error on code that compiled fine with older
versions, and can't seem to find a reason why:

"'string' used as a type, but not defined as a type"

Discussion

  • Luke Dunstan

    Luke Dunstan - 2002-09-18

    Logged In: YES
    user_id=30442

    Please provide some example code that shows this problem.
    If by "older versions" you mean GCC 2.95.x, remember that in
    ISO C++ "string" is in the "std" namespace, so you must use
    either "std::string" or a "using" declaration/directive.

     
  • Kirby Zhou

    Kirby Zhou - 2002-11-18

    Logged In: YES
    user_id=536423

    Did you put "using name space std;" in the head of your file?

     
  • Earnie Boyd

    Earnie Boyd - 2003-01-03
    • status: open --> closed