Hi,
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.
Francois Forster.
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.
Francois Forster.
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 ...)
--
LL
>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.
>Francois Forster.
1. Linker doesn't find _sqrt and other math functions
With a new Slackware 1.2.0 distribution, gcc and ld both can not link the
following:
#include <math.h>
main()
{
float d=3.14;
sqrt(d);
return 0;
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?
--
Zhenya Sorokin
Paper-mail : E. Sorokin, Gusshausstr. 27/359-9, 1040 Vienna, Austria
Voice-mail : +43(1)58801-3801, -3948
Flame-mail : /dev/null
3. functions: why doesn't this short function work?
5. Linux doesn't recognize NIC - Help Please
7. Help - RH Linux doesn't recognize my CD-ROM
8. Apache LoadModule directive
9. Compiler Error -- doesn't find shred library 'libc.so.4'
10. Trouble finding C's math functions: log10(), sin, etc...
11. Liniux doesn't recognize my serial ports correctly-HELP!!!
12. Help - Adding RAM - Linux doesn't recognize
13. HELP: Red Hat install doesn't recognize my SCSI CD-ROM or Hard drives