Mail Archives: djgpp/1993/05/21/10:59:05
Hello,
I have hesitated to ask this question for some time because it seemed to
trivial. After spending several hours of frustration I've decided that it
isn't that trivial afterall and I'ld like to request a little help!
I have written a small test program:
#include <iostream.h>
#include <math.h>
#include <complex.h>
int main(void)
{
Complex x(1.0,2.0),y(2.0,3.0),z;
//oops use z(0,0)...
z=x+y;
cout << z.real();
}
When I compile this with Borland C/C++ it does fine. When I compile this
with GCC I get errors:
complex.o: undefined symbol _sin referenced in text segment...
or something like that. (The compilation line that I use is
gcc XXX.cc -lm -oXXX
I am new to C++... What am I doing wrong!?
Thanks in advance.
Jon Nash
Tesla AT Lamar DOT ColoState DOT EDU
- Raw text -