Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: gtk3 vs. current: nearbyint
On Sat, Feb 09, 2013 at 06:58:40PM +0100, Thomas Klausner wrote:
> It looks like we only have the header:
> > cat test.c
> #include <math.h>
> #include <stdio.h>
>
> int main() {
> printf("%f", nearbyint(3.5));
> }
> > gcc test.c
> /var/tmp//ccWfMjjI.o: In function `main':
> ii.c:(.text+0xd): undefined reference to `nearbyint'
> > gcc test.c -lm
> /var/tmp//ccmUqM0p.o: In function `main':
> ii.c:(.text+0xd): undefined reference to `nearbyint'
>
> Should the math.h change be backed out?
It looks like it...
Just to add to the complication: you have gcc -std=gnu99
"GNU dialect of ISO C99. When ISO C99 is fully implemented in GCC, this will
become the default."
and
"The ISO C99 functions ... nearbyint ... are handled as built-in functions
except in strict ISO C90 mode (-ansi or -std=c90)."
Yet repeating your test:
% cat test.c
#include "/usr/src/include/math.h"
#include <stdio.h>
int main() {
printf("%f", nearbyint(3.5));
return 0;
}
% gcc -std=gnu99 test.c -lm
/var/tmp//ccyv685x.o: In function `main':
test.c:(.text+0xd): undefined reference to `nearbyint'
so still no joy, but it might explain your "conflicting types
for built-in function" warning.
Cheers,
Patrick
Home |
Main Index |
Thread Index |
Old Index