simple g++-3.0 problem
Hi, I'm using the prerelease g++-3.0 for some testing. I've got a weird
compilation problem that I don't understand at all, and I was wondering if
anyone could shed any insight on it.
This program:
// Begin c++ program
#include <string>
#include <iostream.h>
class foo {
public:
foo(){}
~foo(){}
string getString(){
return "harhar";
}
};
int
main( int argc, char *argv[] ){
foo *myFoo = new foo();
cout << myFoo->getString() << endl;
}
// End c++ program
does not compile with g++-3.0 - I get the following error:
~/test/c++> g++-3.0 simple-problem-g++3.cpp -o simple-problem-g++3
simple-problem-g++3.cpp:9: parse error before `)' token
simple-problem-g++3.cpp:12: parse error before `}' token
simple-problem-g++3.cpp: In function `int main(int, char**)':
simple-problem-g++3.cpp:17: no matching function for call to
`foo::getString()'
Basically, it doesn't like the declaration "string getString()"...
g++-2.95.4 doesn't seem to mind this code, and I can't for the life of me
figuer out why it would be broken.
I know this is a prerelease, so maybe that's the problem... Just looking
for ideas. Please Cc me, as I'm not currently subscribed to this list.
Thanks,
Dale
--
Dale E. Martin, Clifton Labs, Inc.
Senior Computer Engineer
dmartin@cliftonlabs.com
http://www.cliftonlabs.com
pgp key available
Reply to: