hello,
I am trying to use complex number to do some matrix
operation, but I got some error message when I tried to
compile it with gcc. can someone know what the problem is .
The following is the test code and the output of compiler
thanks a lot.
#include <stdio.h>
#include <complex.h>
int main(int argc, char **argv)
{
complex<double> Z ;
if (argc < 3)
{
printf(" f1 \n") ;
}
else
{
printf(" f2 \n") ;
}
return 0 ;
}
downlink:~/upload: gcc temp.cpp
Undefined first referenced
symbol in file
complex<double>::complex(double, double)/var/tmp/ccKJjqSH.o
complex<double>::imag(void) const /var/tmp/ccKJjqSH.o
complex<float>::imag(void) const /var/tmp/ccKJjqSH.o
complex<long double>::imag(void) const/var/tmp/ccKJjqSH.o
complex<double>::real(void) const /var/tmp/ccKJjqSH.o
complex<float>::real(void) const /var/tmp/ccKJjqSH.o
complex<long double>::real(void) const/var/tmp/ccKJjqSH.o
complex<float>::complex(float, float)/var/tmp/ccKJjqSH.o
complex<long double>::complex(long double, long
double)/var/tmp/ccKJjqSH.o
ld: fatal: Symbol referencing errors. No output written to
a.out
collect2: ld returned 1 exit status
downlink:~/upload:
--- Begin Message ---
#include <stdio.h>
#include <complex.h>
int main(int argc, char **argv)
{
complex<double> Z ;
if (argc < 3)
{
printf(" f1 \n") ;
}
else
{
printf(" f2 \n") ;
}
return 0 ;
}
downlink:~/upload: gcc temp.cpp
Undefined first referenced
symbol in file
complex<double>::complex(double, double)/var/tmp/ccKJjqSH.o
complex<double>::imag(void) const /var/tmp/ccKJjqSH.o
complex<float>::imag(void) const /var/tmp/ccKJjqSH.o
complex<long double>::imag(void) const/var/tmp/ccKJjqSH.o
complex<double>::real(void) const /var/tmp/ccKJjqSH.o
complex<float>::real(void) const /var/tmp/ccKJjqSH.o
complex<long double>::real(void) const/var/tmp/ccKJjqSH.o
complex<float>::complex(float, float)/var/tmp/ccKJjqSH.o
complex<long double>::complex(long double, long double)/var/tmp/ccKJjqSH.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
downlink:~/upload:
--- End Message ---