This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
string library in gcc 3.0.3?
- From: Ukrit Visitkitjakarn <visiukr at usa dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: 7 Feb 2002 10:03:37 CST
- Subject: string library in gcc 3.0.3?
Dear all,
I just have gcc/g++ 3.0.3 installed in my unix box running HPUX11.
After I installed, I ran a very simple test program named test.cpp using
standard library, <string> and <stdio.h>.
test.cpp:
#include <string>
#include <stdio.h>
int main() {
string a;
a="test";
printf ( "test message: %s", a.c_str());
return 0;
}
During the compilation(g++ test.cpp), I got the following error message:
test.cpp: In function `int main()':
test.cpp:5: `string' undeclared (first use this function)
test.cpp:5: (Each undeclared identifier is reported only once for each
function
it appears in.)
test.cpp:5: parse error before `;' token
test.cpp:6: `a' undeclared (first use this function)
To double check, I use -H option to print out the include header file and
found that <string> is one of the included files.
I never received these error messages in the earlier version of gcc (running
in HPUX 10.x)
Guys, could you please help me fix and understand this problem ? ** please
reply to my email address, I am not in the gcc mailing list **
Thanks you very very much
Ukrit
____________________________________________________________________
Get free e-mail and a permanent address at http://www.amexmail.com/?A=1