Date: Wed, 5 Aug 92 16:54:36 EST From: s923230 AT minyos DOT xx DOT rmit DOT OZ DOT AU (Paul Gortmaker) To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Complex Numbers (complex.h) I am trying to use the complex number include file complex.h, and am having some trouble. Here is a simple program that exhibits the same difficulty // COMPLEX.CXX -- does not link math funtions in complex.h with libm.a #include #include // Also a path to math.h and stream.h int main(void) { complex i; i=(0,1); cout << i << endl; return(0); } I am running GCC on a 80486. This program will compile and produce an object file with "gcc -c complex.cxx" with no warnings or errors. However, if I try and link it (either by "gcc complex.cxx -lm" or by "ld complex.o -lm") it seems to not link the functions in the include file with libm.a, and prints a stream of error messages such as: complex.o :Undefined symbol _exp referenced from text segment There is one for each math function, sin, cos, sinh, etc. If I am using just real numbers, (so no "#include ") and link with libm.a (via gcc (filename) -lm) everything works fine. Oh yeah, it's version 2.0 -- and thanks in advance for any help. Paul Gortmaker. s923230 AT minyos DOT xx DOT rmit DOT oz DOT au Melbourne Aus.