stupid g++ question

Jerry Feldman gerry.feldman at compaq.com
Thu Mar 14 11:39:46 EST 2002


I have a simple hello world program that uses the string class. This 
compiles and runs ok on some commercial c++ compilers but not on g++ (2.95 
and 3.03). This is just one sanitized issue with a larger system.
#include <iostream.h>
int main()
{
        cout << "Hello, world!" << "\n";
}
phbs.gf:src [158%] g++ hello.cc -o hello
hello.cc: In function `int main()':
hello.cc:5: `string' undeclared (first use this function)
hello.cc:5: (Each undeclared identifier is reported only once for each 
function it appears in.)
hello.cc:5: parse error before `;' token
hello.cc:6: `s' undeclared (first use this function)

phbs.gf:src [159%] cxx hello.cc -o hello
phbs.gf:src [160%] hello
Hello, world!


--
Jerry Feldman
Portfolio Partner Engineering   
508-467-4315 http://www.testdrive.compaq.com/linux/

Compaq Computer Corp.
200 Forest Street MRO1-3/F1
Marlboro, Ma. 01752




More information about the Discuss mailing list