0

I am trying to compile some C code on a beagleboard xm. I try to compile, but I get the error: undefined reference to 'isfinite' which is in the math.h library. This code compiles perfectly in all my other computers, and I do include -lm in my makefile.

I suspect that it may be my compiler, maybe it is an over version? On the beagleboard it's version 4.3.3, but on my computer it's 4.7.3, but I don't know how to get a later version. I thought opkg would automatically get the latest available.

Any ideas why this may be happening?

4

2 回答 2

1

该函数infinite()是 C99 的一部分。您的编译器默认使用旧版本的 C 语言。您需要使用该标志进行编译-std=c99以启用此宏。

`gnu89' ISO C90 的 GNU 方言(包括一些 C99 特性)。这是 C 代码的默认设置。

http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/C-Dialect-Options.html

于 2013-06-19T22:05:03.327 回答
0

isfinite是 C++11 标准的一部分,而 gcc 4.3.3 已经过时了。尝试 int finite(double x);int finitef(float x);

于 2013-06-19T22:03:26.373 回答