Mail Archives: djgpp/1994/10/05/02:37:04
There is a problem comiling programs using complex numbers in 2.6.0.
The header file <complex.h> contains an error in the line
#include <Complex.h>
which should read
#include <_Complex.h>
If the -Wall option is on then one gets lots of compile time warnings, e.g.:
c:/djgpp/cplusinc/_Complex.h:171: warning: `operator ==
(const Complex &, const Complex &)' was declared `extern' and later `static'
These appear to be caused by function definitions being declared inline
whereas previous prototypes were not (just ignore them).
One then gets link errors, e.g.:
x.cc(.text+0x1f): undefined reference to `Complex::Complex(double, double)'
x.cc(.text+0x2f): undefined reference to `Complex::~Complex(void)'
A similar problem was reported recently when using the setw(), setiosflags(),
etc. manipulators in <iomanip.h>, e.g.:
P13_5.cc(.text+0x85): undefined reference to
`operator<<(ostream &, smanip<int> const &)'
By undefining the named constant __GNUG__ and recompiling these go away, i.e.:
#undef __GNUG__
#include <complex.h>
#include <iomanip.h>
Brian Bramer, (bb AT dmu DOT ac DOT uk) De MontFort University, UK.
- Raw text -