Ibrahim Haddad wrote:
> 
> Hello Friends,
> 
> I am writting a small utility program for my project that needs to use
> the sqrt() function. Now, I am inlcuding the <math.h> library but I am
> getting the following error message when compiling: cc fit.c
> >undefined reference to 'sqrt'
> 
> Any idea of a possible solution??
> By the way, the math.h file resides in my Linux machine under /usr/include
> 

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

 


-- 
email: [EMAIL PROTECTED]
Local mailserver <landreau.ruffe.edu> , remote <ns.computer.net>

He was not at all afraid for to be mashed into a pulp, or to have his
eyes gouged out and his elbows broken.

Reply via email to