[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Missing "floor"?
- Subject: [ale] Missing "floor"?
- From: leamhall at gmail.com (leam hall)
- Date: Wed, 19 Jun 2013 10:18:13 -0400
Not sure why I'm getting:
gcc -Wall -Werror -o rand rand.c
/tmp/ccAJ7e8S.o: In function `main':
rand.c:(.text+0x16): undefined reference to `floor'
collect2: ld returned 1 exit status
###
rand.c
###
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <math.h>
int main(void) {
int num;
float val = 2.3;
num = floor(val);
printf("num is %d.\n", num);
return 0;
}
--
Mind on a Mission <http://leamhall.blogspot.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20130619/4167ad3b/attachment.html>