implicit declaration of function <= 欠缺標頭檔

是因為在C 編譯器裡,如果你如果直接使用函式而無include其標頭檔的話,
在編譯(compile)時C 編譯器會暫時相信你而並不會顯示錯誤,
只會給你一個警告:implicit declaration of function <函式名>。
但是在link時,C 編譯器會在你的程式及基本函式庫裡找你所用的函式。
如果找不到,C 編譯器就會給你一個linker錯誤:undefined reference to <函式名>。
若找得到就無事。

arrow
arrow
    全站熱搜

    BB 發表在 痞客邦 留言(1) 人氣()