Mail Archives: djgpp/1994/02/14/04:39:35
>>>From: simon AT tesla DOT ee DOT mcgill DOT ca ( Simon Chamlian tlf 341-5303)
>>>To: djgpp AT sun DOT soe DOT clarkson DOT edu
>>>Subject: help
>>>
>>>Hi,
>>> ...
>>> #include <stdio.h>
>>> #include <math.h>
>>>
>>> main()
>>> {
>>> double fk=2.06;
>>>
>>> printf(" res = %e \n", log(fk));
>>> }
>>>
>>> ...
>>>-Simon
>>>
>>>----------------------------------- screen dump -------------------------
>>>
>>>D:\COMPILER\GNUCPP\FICHIER>gcc test.cc
>>>test.o: Undefined symbol _log referenced from text segment
>>>
The best way to avoid such problems is to use the "-v" option. This
would have shown, that there's a problem with LD.EXE. The linker
can't find the function LOG() in the standard archive-files. You need to
link with a library containing the LOG-function (LIBM.A):
gcc -v test.cc -lm
should compile correctly.
Paul
--
Technische Universitaet Wien
Institut fuer Werkstoffe der Elektrotechnik
Dipl.-Ing. Paul FULMEK
Tel. (+43 222) 58801/3955
FAX: (+43 222) 50 41 587
Gusshausstrasse 27-29
Austria - 1040 WIEN
- Raw text -