>> the sqrt() function. Now, I am inlcuding the <math.h> library but I am

Actually, math.h is just a header file.

>You have to specify the math library that you want the compiler to
>search,
>either "/usr/lib/libm.a" (static library), or "/usr/lib/libm.so" (shared
>library).
>
>The following should suffice:
>
>$ gcc -o fubar fubar.c /usr/lib/libm.so

Hmm. I don't know if that works but at least it isn't the common way.
Use rather
        gcc -o fubar fubar.c -lm
or (to use static linking)
        gcc -static -o fubar fubar.c -lm

If you'd want to specify the library path, you could use
        gcc -o fubar fubar.c -lm -L/lib
(usually shared libm.so is in /lib directory)

--
| Tuukka Toivonen <[EMAIL PROTECTED]>       [PGP public key
| Homepage: http://www.ee.oulu.fi/~tuukkat/       available]
| Try also finger -l [EMAIL PROTECTED]
| Studying information engineering at the University of Oulu
+-----------------------------------------------------------

Reply via email to