Bug 77415 - math.h compile problem + 7.2
Summary: math.h compile problem + 7.2
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.2
Hardware: i586
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2002-11-06 18:47 UTC by Dan Bishop
Modified: 2007-04-18 16:48 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2002-11-06 18:47:52 UTC

Attachments (Terms of Use)

Description Dan Bishop 2002-11-06 18:47:45 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Description of problem:
 I have been compiling a C program using the "gcc" available in this 
 version. I am trying to use the "log10" function normally part of the math.h 
library. The compiler does not balk at the "#include " line however it fails to 
recognize the function. The same was true of other math.h functions (exp and 
log). My compile command line is "gcc filename.c -o output_file". Is there a 
bug fix that I need for the libraries or something missing? Thanks.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create filename.c file with "#include <math.h>" and use log10 or log or exp 
function in the file (could be in main).
2.Attempt to compile "gcc filename.c -o target_name"

Actual Results:  If you don't use any math functions the library will load, but 
if you try to use "log10" or "log" or "exp" (and probably all the other math.h 
functions) it can't find them, even though it seems to find the library.

Expected Results:  Since library is loaded it should recognize these standard C 

Additional info:

Comment 1 Jakub Jelinek 2002-11-06 18:51:34 UTC
You need to add -lm to the command line.

Note You need to log in before you can comment on or make changes to this bug.