作者Storm (風)
看板Linux
標題Re: 問題:不明函式finite()
時間Wed Jun 11 10:35:39 2008
※ 引述《[email protected] (舊的關係開始一一切斷)》之銘言:
: 最近編譯一隻程式時,遇到finite()函式未定義的錯誤訊息。
: 然後就開始尋找finite()就近是屬於哪個函式庫的。
: 結果就是找不到,看起來像是C++的某個函式。
: 但是Google找不到,翻開C++數學函式沒有這個,
: GSL也沒有,libstdc++手冊都沒有。
: 所以只好上來向大家求助了。希望大家告訴
: 我它來自什麼函式庫的名稱就可以了,謝謝。
你這樣的描述太過糢糊了,一般來說,要先去看看 source code 裡面有引用了
哪些 header file,看看 Makefile 裡面有引用了哪些 library,然後才能確定
finite() 到底是哪個 library 的函式。
不過基本上,用 man 查一下不就有了?你的系統的 manpage 不完整嗎?
節錄以下 finite(3) 的 manpage:
<quote>
FINITE(3) Linux Programmer's Manual FINITE(3)
NAME
finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl
- BSD floating point classification functions
SYNOPSIS
#define _BSD_SOURCE
#include <math.h>
int finite(double x);
[中略]
DESCRIPTION
The finite() functions return a non-zero value if x is neither infinite
nor a "not-a-number" (NaN) value, and 0 otherwise.
[中略]
NOTES
Note that these functions are obsolete. C99 defines macros isfinite(),
isinf() and isnan() (for all types) replacing them. Further note that
the C99 isinf() has weaker guarantees on the return value. See fpclas-
sify(3).
On a glibc system, these functions are declared by <math.h> when
_BSD_SOURCE or _SVID_SOURCE or _GNU_SOURCE is defined. The isnan()
functions will also be declared when _XOPEN_SOURCE is defined.
[後略]
</quote>
請注意變色的部分。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 70.155.125.254