This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: About log() in GCC
- To: JN_Lin AT utc.com.tw
- Subject: Re: About log() in GCC
- From: Martin Kahlert <martin.kahlert AT mchp.siemens.de>
- Date: Wed, 15 Sep 1999 09:05:21 +0200
- Cc: egcs AT egcs.cygnus dot com
- References: <482567ED.0025E8FB.00@utcoa01.utc.com.tw>
- Reply-To: martin.kahlert AT mchp.siemens.de
Quoting JN_Lin@utc.com.tw (JN_Lin@utc.com.tw):
>
>
> Dear :
> When I want to use "log" in my program, I must include the header
> file math.h. But when I compiler my program ,some message showing as
> following:
>
> Undefined first referenced
> symbol in file
> log /var/tmp/cca0060l1.o
> ld: fatal: Symbol referencing errors. No output written to a.out
Append -lm to your link line. I think this is the most frequently asked question
in all gcc-* newsgroups.
-lm links in the mathematical functions library libm.* I don't know, why
they were seperated from libc.* but it's the same on every UNIX i use.
Hope that helps,
Martin.
--
esa$ gcc -Wall -o ariane5 ariane5.c
ariane5.c: 666: warning: long float implicitly truncated to unsigned type
esa$ ariane5