www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/02/14/04:39:35

To: simon AT tesla DOT ee DOT mcgill DOT ca
Subject: Re: help
From: pfulmek AT email DOT tuwien DOT ac DOT at (Paul FULMEK)
Reply-To: pfulmek AT email DOT tuwien DOT ac DOT at
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Date: Mon, 14 Feb 1994 09:20:42 +0000

>>>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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019