complex ostream
H.J. Lu
hjl@lucon.org
Wed Jan 14 00:45:00 GMT 1998
>
> Hi,
> why does this now suddenly fail with
>
Are you sure it worked before? Which releases did it work 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);
> }
>
--
H.J. Lu (hjl@gnu.org)
More information about the Gcc
mailing list