gcc questions

Dotan Cohen dotancohen at gmail.com
Sat Nov 26 22:57:29 UTC 2005


On 11/27/05, Dave Mitchell <davem at iabyn.com> wrote:
> On Sat, Nov 26, 2005 at 11:47:43PM +0200, Dotan Cohen wrote:
> > [dotancohen at localhost מדעי המחשב]$ gcc 1_3.c
> > /tmp/cc0PB7X5.o(.text+0x18b): In function `main':
> > 1_3.c: undefined reference to `sqrt'
> > collect2: ld returned 1 exit status
> > [dotancohen at localhost מדעי המחשב]$
>
> You need to link in the maths library, "m":
>
> gcc -lm 1_3.c
>
>

Thank you, it compiled now. I just spacebar'ed about 100 times in the
gcc man page looking for the "m" option that you mention. I did find
the "l" option (search the library named library when linking), but
not the "m" option.

Dotan Cohen
http://technology-sleuth.com/short_answer/what_is_a_cellphone.html




More information about the fedora-list mailing list