This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

complex ostream


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);
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]