Problem: The String Class:gcc 2.8.1
McKnight, John
jmcknigh@bindview.com
Wed Nov 10 08:18:00 GMT 1999
I'm trying to use the g++ string class. Unfortunately, I can't find a
document to rtfm it's usage. I am using gcc 2.8.1 on solaris 7. I can
compile a file using iostream.h successfully. Unfortunately, I can't find
any info on the string.h include file (or its location for reading). Should
I get my own from the web? Or is it included in the shared library? I try
the following, but get errors:
"helloworld.cxx" 8 lines, 105 characters
bvtsunix01.bindview.com% echo $LD_LIBRARY_PATH
/usr/openwin/lib:/space/opt/ORCLora8/8.0.5/lib:/usr/local/lib
bvtsunix01.bindview.com% cat helloworld.cxx
#include <iostream.h>
#include <string.h>
int main()
{ String x = "Hello World"
cout << x << endl;
}
bvtsunix01.bindview.com% g++ helloworld.cxx
helloworld.cxx: In function `int main()':
helloworld.cxx:5: `String' undeclared (first use this function)
helloworld.cxx:5: (Each undeclared identifier is reported only once
helloworld.cxx:5: for each function it appears in.)
helloworld.cxx:5: parse error before `='
bvtsunix01.bindview.com%
Thanks,
John McKnight
More information about the Gcc-bugs
mailing list