Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Where are the math functions in FC4?

 
   Soft32 Home -> Linux -> General Discussions RSS
Next:  Stats linux.redhat (last 7 days)  
Author Message
Shel

External


Since: Jun 26, 2006
Posts: 10



(Msg. 1) Posted: Sun Jun 25, 2006 10:27 pm
Post subject: Where are the math functions in FC4?
Archived from groups: linux>redhat (more info?)

I created a very simple c program using sqrt(), and used the math.h include
file. When I compile using gcc I get an "undefined reference to sqrt"
message. Other math functions such as sin or cos also do not work. It looks
like the function definitions are missing. Any help would be appreciated.

Shel Sherman
Back to top
Login to vote
Markku Kolkka

External


Since: Oct 02, 2003
Posts: 263



(Msg. 2) Posted: Mon Jun 26, 2006 9:26 am
Post subject: Re: Where are the math functions in FC4? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Shel wrote:

> I created a very simple c program using sqrt(), and used the math.h
> include file. When I compile using gcc I get an "undefined reference
> to sqrt" message.

You must link your program with the math library. Add "-lm" on the GCC
command line.

--
Markku Kolkka
markku.kolkka.TakeThisOut@iki.fi
Back to top
Login to vote
Shel

External


Since: Jun 26, 2006
Posts: 10



(Msg. 3) Posted: Mon Jun 26, 2006 9:26 am
Post subject: Re: Where are the math functions in FC4? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

That worked. I don't remember having to use that switch with previous
versions of Fedora. Thanks for your help.


"Markku Kolkka" <markku.kolkka.TakeThisOut@iki.fi> wrote in message
news:449fc474$0$22346$39db0f71@news.song.fi...
> Shel wrote:
>
>> I created a very simple c program using sqrt(), and used the math.h
>> include file. When I compile using gcc I get an "undefined reference
>> to sqrt" message.
>
> You must link your program with the math library. Add "-lm" on the GCC
> command line.
>
> --
> Markku Kolkka
> markku.kolkka.TakeThisOut@iki.fi
>
Back to top
Login to vote
Display posts from previous:   
Related Topics:
need for functions - Hello for the installation of rkdet, I need the functions (/etc/init.d/functions) In my distribution they seem not to....

Parallels between windows and Red Hat functions? - Dear friends, I'm looking for an overview and paralleling of similar functions between windows and red hat 9. Eg., is..

disk cleanup - Hi all, I installed RH8.0 with including all the options (everything) on an 8 gig partition. I've been doing up2date..

Cannot start x config in Mandrake 9.1 - I disabled auto-start up into a GUI like KDE So now I am at the command prompt [root@hostname /]# I type ..

Where to discuss Ximian? - I have Red Hat 9 and Ximian Desktop 2. A few issues have come up, but I'm not sure of the best group to post to. Any....

Move directories to different drive -- How?? - System: Compaq PC with 6GB hard drive RedHat 9 Linux Hard drive chopped into 3 Primary and 1 Extended partitions...
       Soft32 Home -> Linux -> General Discussions All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]