# gcc -o program code.c -lm

Make sure you're remembering to include the library at compile time. The 
math functions are not part of the standard C library :)

On Thu, 21 Feb 2002, Frank Carreiro wrote:

> Not sure if this is the right list for it but here goes...
> 
> I'm currently learning how to code in C.  I'm using a RedHat 7.1 
> workstation which when installed I selected to install everything (I 
> don't like messing with dependancies ::grinz::).  I've been including 
> stdio.h and the last few weeks everything has been happy.  The last 
> couple of days I've been learning about math.h however it's failing when 
> I try and compile.  Getting the following message:
> 
> ---
> 
> In function `main`:
> undefined reference to `pow`
> collect2: ld returned 1 exit status
> 
> ---
> 
> I'm trying to calculate a value (x) raised to the y power.  I suspect 
> there is a library not found by the linker (wild guess).
> 
> Any thoughts on how I can track this down?
> 
> Thx
> 
> 
> 
> 
> 
> _______________________________________________
> Redhat-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-list
> 

-- 
-Statux



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to