EnderUNIX Team.

EnderUNIX tips

Mail to My Friend , Home Page

[ C/C++ ]

"math.h - "undefined reference to ..."" - Metin KAYA - (2007-05-15 16:21:18)   [24319]

You can get "undefined reference to ..." error while you're trying to use math.h functions such as (log, logf, ...), although the "math.h" library has been included in your code. The reason behind that is these functions being not implemented in libc. Thus, you have to compile your code with "-lm" parameter. For instance:

# gcc -lm -Wall -pedantic -ansi -o foo foo.c

* Thanks a lot to Ozkan KIRIK.

Mail to My Friend , Home Page