This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
complex ostream
- To: egcs at cygnus dot com
- Subject: complex ostream
- From: heinrich roder <hro at barney dot lanl dot gov>
- Date: Mon, 12 Jan 1998 15:49:17 -0700
Hi,
why does this now suddenly fail with
/tmp/cca205341.o: In function `main':
/tmp/cca205341.o(.text+0xf6): undefined reference to `ostream & operator<<<float>(ostream &, complex<float> const &)'
collect2: ld returned 1 exit status
Does anybody know what I have messed up?
tqvm Heinrich
#include <iostream.h>
#include <complex.h>
template<class T>
inline T sqr(T x){ return x*x;}
int main(){
int i=1;
float f=3.1;
double d=4.4;
complex<float> c(3.1,4.1);
cout << sqr(i) << endl;
cout << sqr(f) << endl;
cout << sqr(d) << endl;
cout << sqr(c) << endl;
return (0);
}