August 5th, 2003, 08:42 AM
g++ not recognizing functions
I'm trying to compile source code for an application i downloaded
I am using the g++ 3.2.1 compiler.
For some reason, it stumbles on function declarations that
look like this:
cplus-dem.c:93: `ch' was not declared in this scope
cplus-dem.c:94: variable or field `set_cplus_marker_for_demangling' declared
cplus-dem.c:94: `int set_cplus_marker_for_demangling' redeclared as different
kind of symbol
../include/demangle.h:120: previous declaration of `void
I.e. it expects the declaration to be
"void set_cplus_marker_for_demangling (int ch)".
How do I force it to recognize that kind of declaration? Obviously
the authors of gdb were able to compile their code somehow, so
I'm guessing that I'm missing some comiler option. Does anyone have any idea?
Thanks in advance.
August 5th, 2003, 09:21 AM
You have old style C code
The function declaration is old style Kernighan and Ritchie and probably is no longer supported by your compiler's default configuration. I expect there is a switch you can set, check your man pages and look up "Kernighan and Ritchie" or "K&R"