gcc math.h won't include

Mark Glassberg mark_glassberg at valley.net
Fri Feb 27 16:33:30 EST 1998


> 
> You're missing the linker flag to add the math library:
> 
> gcc calcint1.c -lm
> 
> You can tell this is the problem because the keywords "undefined reference"
> means that the code for the pow function is missing.
> 
> And the math functions are in the library called 'm'.  Of course you can't
> seem to tell that from the manual pages, but now you know =)  
> A good book on C should point this out, though.
> 
> 
> . . . Sean.
> -------
> Ex ignorantia ad sapientiam; e luce ad tenebras.
> Out of ignorance into knowledge; from the light into the darkness.
> 
Right you are!  Thanks a million.



More information about the Discuss mailing list