Re: 問題:不明函式finite() - Linux

By Robert
at 2008-06-11T10:35
at 2008-06-11T10:35
Table of Contents
※ 引述《[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>
請注意變色的部分。
--
: 最近編譯一隻程式時,遇到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>
請注意變色的部分。
--
Tags:
Linux
All Comments
Related Posts
proftpd的LangDefault用途

By Gilbert
at 2008-06-11T01:55
at 2008-06-11T01:55
Re: 整合多顆小硬碟LVM?Raid0?

By Rebecca
at 2008-06-11T01:52
at 2008-06-11T01:52
整合多顆小硬碟LVM?Raid0?

By Olive
at 2008-06-10T22:21
at 2008-06-10T22:21
EeePC的解析度

By Charlie
at 2008-06-10T21:41
at 2008-06-10T21:41
我的Ubuntu會自動跳出圖形介面

By Queena
at 2008-06-10T20:47
at 2008-06-10T20:47