The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Float and Double in Perl Euler04 Shell Programming and Scripting 5 03-14-2008 09:31 AM
max precision in float useless79 High Level Programming 6 11-07-2007 11:42 PM
Float calculations sharmavr UNIX for Dummies Questions & Answers 1 07-25-2006 11:18 PM
float comparison mkan Shell Programming and Scripting 3 09-13-2005 10:39 PM
comparing two float values kavitha Shell Programming and Scripting 2 04-02-2004 10:32 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-14-2007
Registered User
 

Join Date: Nov 2006
Posts: 17
math.h: float ceilf(float x)

Good morning,

I'm testing the use of ceilf:
Code:
/*Filename: str.c*/
#include <stdio.h>
#include <math.h>

int main (void)
{
float ceilf(float x);

int dev=3, result=0;

float tmp = 3.444f;



printf("Result: %f\n",ceilf(tmp));
return 0;
}
Compiling, I get
Code:
root@slackware:~/ncurses# gcc str.c -o tester
/tmp/cc6C3DIO.o(.text+0x30): In function `main':
: undefined reference to `ceilf'
collect2: ld returned 1 exit status
Can somebody find my error ? I've tested in 2 machines...
Thank you in advance.
Reply With Quote
Forum Sponsor
  #2  
Old 06-14-2007
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,698
Quote:
Originally Posted by jonas.gabriel
Compiling, I get
Code:
root@slackware:~/ncurses# gcc str.c -o tester
/tmp/cc6C3DIO.o(.text+0x30): In function `main':
: undefined reference to `ceilf'
collect2: ld returned 1 exit status
Can somebody find my error ? I've tested in 2 machines...
Thank you in advance.
Code:
gcc str.c -o tester -lstdc++
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:24 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0