我爲我的C項目之一使用HTParse.c模塊。然而,隨着未知類型名BOOL編譯鏈接頭文件錯誤
gcc -o project project.c -lpthread
編譯時我收到以下編譯器錯誤在頭文件中:
In file included from Gserve.c:12:0:
/usr/local/include/w3c-libwww/HTParse.h:117:8: error: unknown type name ‘BOOL’
extern BOOL HTURL_isAbsolute (const char * url);
^
/usr/local/include/w3c-libwww/HTParse.h:192:8: error: unknown type name ‘BOOL’
extern BOOL HTCleanTelnetString (char * str);
^
我已閱讀,包括與C99 stdbool.h和C90不支持布爾數據類型。即使包含此標題後,錯誤仍然存在。我已經包括這些標頭如下:
#include<stdbool.h>
#include<w3c-libwww/HTParse.h>
在安裝庫期間可能出現了問題嗎?然而,讓我什麼也沒看見在可疑我沒有在年底出現某些錯誤「須藤使安裝」 ......
collect2: error: ld returned 1 exit status
Makefile:660: recipe for target 'libapp_2' failed
make[2]: *** [libapp_2] Error 1
make[2]: Leaving directory '/usr/local/src/w3c-libwww- 5.4.0/Library/Examples'
Makefile:174: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/usr/local/src/w3c-libwww-5.4.0/Library'
Makefile:263: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
我使用Ubuntu的15.10。
你們有什麼想法解決這個問題嗎?
非常感謝!
「我已經閱讀包含與C99的stdbool.h,並且C90不支持布爾數據類型」 - 嗯,'BOOL'來自*既不*。它通常是一個在* Windows *頭部定義爲「int」的宏,或者在非Windows平臺上編譯的兼容頭。看來你有* *既*。 – WhozCraig
在引用這些引號之前是否還有其他#include指令?你能編譯一個只包含'#include'的文件嗎? –