LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-06-2011, 04:26 PM   #1
worsel
Member
 
Registered: Feb 2008
Location: Washington State, USA
Distribution: Slackware 14.2, Slackware-from-Scratch
Posts: 241

Rep: Reputation: 45
What happened to "round" and "pow" functions?


About eleven years ago I wrote several small financial programs in C.
Today I went to modify them. When I tried to compile, I got the
messages "Undefined reference to 'pow'" and "Undefined reference to 'round'".

According to the manual, these are defined in math.h. Couldn't find them there
and searches through /usr/include were indefinite at best.

Using gcc-4.4.

TIA, John
 
Old 03-06-2011, 04:39 PM   #2
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
Did you remember to link against the math library, i.e. use -lm linker option?
 
Old 03-06-2011, 04:41 PM   #3
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Try using the -lm linker flag when you compile it.

Cheers,

Josh
 
Old 03-06-2011, 10:19 PM   #4
worsel
Member
 
Registered: Feb 2008
Location: Washington State, USA
Distribution: Slackware 14.2, Slackware-from-Scratch
Posts: 241

Original Poster
Rep: Reputation: 45
Unhappy

Thanks. The problem was not using C for too many years.

John
 
Old 03-07-2011, 09:46 AM   #5
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Operater error, huh?
 
  


Reply

Tags
[c]



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM
"GRUB _" when booting, nothing but "ctrl+alt+del" functions rabidpencil Linux - Newbie 15 08-08-2006 10:20 AM
C/C++ functions similar to BASH's "cp", "mv", "mkdir", etc? kornerr Programming 10 04-23-2006 09:48 AM
learned "aliases", what are "functions" in .bashrc? learnfast Linux - Newbie 3 03-15-2005 04:24 AM
"ifcfg-ethx" and "network-functions" files peok Linux - Networking 12 08-13-2003 06:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration