I am running gcc on a program that uses exp, log and pow.
I use -lm as an option for the math library but it tells me
undefined reference to 'exp', 'log' and 'pow'.
Suggestion will be greatly appriciated.
gcc -lm -o xxx xxx.c
does not work ... You have to move the -lm option to the end of the line
gcc -o xxx xxx.c -lm
(I am using slackware 2.3 , gcc 2.6.3 ...)
>I am running gcc on a program that uses exp, log and pow.
>I use -lm as an option for the math library but it tells me
>undefined reference to 'exp', 'log' and 'pow'.
>Suggestion will be greatly appriciated.
With a new Slackware 1.2.0 distribution, gcc and ld both can not link the
The error report is:
/tmp/cca003971.o: Undefined symbol _sqrt referenced from text segment
I tried gxx, -fno_builtin, -traditional, some other switches.
There must be a simple solution, right?
Paper-mail : E. Sorokin, Gusshausstr. 27/359-9, 1040 Vienna, Austria
Voice-mail : +43(1)58801-3801, -3948
Flame-mail : /dev/null