[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [*] about gcc



On Mon, Feb 07, 2000 at 04:38:32 +0900, Junichi Uekawa wrote:
> you need to do gcc -lm to link the maths library.
> 
> Don't ask me why. 

Because the linker and the preprocessor are independent programs involved in
the compile process. #include causes the compiler to know about the
prototypes (arguments and return type) of a function like sqrt(). -lm tells
the linker to actually link against the library libm.so which actually
implements the sqrt() function.

HTH,
Ray
-- 
ART  A friend of mine in Tulsa, Okla., when I was about eleven years old. 
I'd be interested to hear from him. There are so many pseudos around taking 
his name in vain. 
    - The Hipcrime Vocab by Chad C. Mulligan 


Reply to: