GCC >= 3 problems
Paolo Carlini
pcarlini@unitus.it
Wed Jan 23 07:45:00 GMT 2002
Steve Marotta wrote:
> I've been working with GCC for several years now, and have been
> generally very pleased with the compilers. Recently I tried installing
> GCC v3.0.3, and upon successful installation, I tried compiling a piece
> of code under a library that I knew to be working under GCC 2.95.3. It
> began flooding me with error messages saying that functions in the
> library files did not work. Here are a few of the errors...
>
> c++ -I/usr/local/include -I/usr/include/mysql -g -O2 -c sample.cxx
> In file included from /usr/local/include/coldata1.hh:7,
> from /usr/local/include/sqlplus.hh:12,
> from sample.cxx:3:
> /usr/local/include/exceptions.hh:65: parse error before `er'
> /usr/local/include/exceptions.hh:65: missing ';' before right brace
> /usr/local/include/exceptions.hh:66: ISO C++ forbids defining types within
> return type
> /usr/local/include/exceptions.hh:66: syntax error before `;' token
>
> Incidentally, the lines in questions are as follows...
>
> struct BadQuery {
> BadQuery(string er) : error(er) {}
> string error; //: The error message
> };
Most probably this is due to the fact that 3.0.x correctly implements ISO/ANSI
namespaces and the string class is in namespace std. Try changing the
occurrences of string with std::string and see what happens...
Cheers,
Paolo.
More information about the Gcc
mailing list