|[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]|
On Saturday, February 15, 2003, at 08:13 p, M. Uli Kusterer wrote:
g++ -c Parser.C
Parser.C: In member function `void Parser::command(std::istream&,
Parser.C:61: `string' undeclared (first use this function)
Parser.C:61: (Each undeclared identifier is reported only once for each
function it appears in.)
Parser.C:61: parse error before `,' token
make: *** [Parser.o] Error 1
As someone else already wrote, your error is that you're ignoring namespaces. You're supposed to *either* write std::string to access the string class, or you need to specify a "using namespace std;" after including <string> to make sure the compiler knows it's supposed to look for the symbol string in namespace std if it can't find it in the local namespace.
You might have gotten away without that so far, as the 2.x versions of GCC didn't yet support namespaces (they gracefully ignored any namespace qualifiers and treated everything as one big namespace just like in the old C days), so this might be new with GCC 3 (which arrived with 10.2, I think).
Another thing that may cause problems is your use of the suffix ".C" -- I'm not sure whether using this case-sensitive suffix works on HFS+ vlumes under OS X. It *should* work just fine, but just as a last resort, I'd try changing that to ".cp" or ".cpp" to make sure you get the C++ compiler -- some of the names are aliased to gcc, so you might be getting the C compiler by accident.
M. Uli Kusterer
"The Witnesses of TeachText are everywhere..."
_______________________________________________ studentdev mailing list | email@hidden Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/studentdev Do not post admin requests to the list. They will be ignored.
Visit the Apple Store online or at retail locations.
Copyright © 2011 Apple Inc. All rights reserved.