Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with the ceil command...

Status
Not open for further replies.

j0hnb

IS-IT--Management
Aug 31, 2004
11
0
0
US
The ceil command is causeing my program to not compile.. is there another command that would have the same effect. to round a number up to it's next whole #.
 
What platform, what compiler and what error messages?
 
I am using my schools complier olympus.. it might be a problem with my command...
years = ceil(years);
the error message was:
/var/tmp/ccLYNv1d.o(.text+0x264): undefined reference to `ceil'

 
You are not linking the maths libraries in. How you do this depends on the compiler (refer to the manuals) but under gcc it is done with the -lm switch -

gcc -o appname appname.c -lm

Cheers - Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top