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

Re: gcc 2.95 and Standard C



>>>Okay. I'm in a C class full of Borland C/C++ 4.5 for Windoze. Std C
>>>libaries
>>> contain pow() and sqrt() (power and square root) in <math.h>.
>>> So where the fsck are they in gcc?????
>>They are defined in <math.h>.  You also have to link it against libm.
>Okay. Thank you.
>gcc merely complained that it could not find functions named pow() and 
>sqrt(), though I DID use:
>#include<math.h> 
>in it. (Worked for Borland.)

It may be adding dll's/symbols on the fly for you.  Which is nice, till it gets
'em wrong.

>And may I ask what the @*&#$ is libm, aside from, I presume, some

libm is the math library.  The libraries are quite modular,  so they can be
small, and you don't have to link against ones you don't want.

>addition to libc? And I do not remember libm being mentioned on the pow() 
>or sqrt() 

You're correct.  I was told once that the man pages for functions are not meant
as full documentation, but simply to help jog the memory about paramater lists
etc...  I'd get a copy of the gcc user's manual and the glibc reference.  Be
prepared, as it fills two three-inch three ring binders.  But it's
pricelesss...  You'll know WAY more about what's going on than the Borland
manuals (I'm a previous Borland guy) ever even hint at.  Good for understanding
strace output too.

Systems and Network Administrator
Morrison Industries
1825 Monroe Ave NW.
Grand Rapids, MI. 49505