clang编译c语言,clang没有编译c程序?
在c中編程時,我使用clang編譯大部分時間.突然它停止了工作.每當我嘗試編譯某些內容時,它都會給我這個輸出
假設文件名是test.c
clang test.c
In file included from test.c:1:
/usr/include/stdio.h:33:11: fatal error: 'stddef.h' file not found
# include
^
1 error generated.
test.c的來源是:
#include
#include
int main( int argc, char *argv[] )
{
printf("\nthis is a sample c program\n");
return EXIT_SUCCESS;
}
注意:在像gcc這樣的其他編譯器上它仍然有效.
我應該怎么做讓clang回來工作?
如果您需要有關系統的任何信息:
我正在使用Ubuntu 13.10 32位.
文本編輯器:Emacs.
我也試圖卸載clang然后重新安裝仍然得到相同的錯誤.
我在“usr / include / linux”中找到了該文件,然后將其粘貼到“usr / include”中,它現在向我顯示同一文件的錯誤但要求另一個
In file included from test.c:1:
In file included from /usr/include/stdio.h:74:
/usr/include/libio.h:50:10: fatal error: 'stdarg.h' file not found
#include
^
1 error generated.
現在我試圖搜索新文件“”并在不同的文件夾中找到多個具有相同名稱的文件,這使得它令人困惑,這是我需要在clang目錄中復制粘貼的正確文件.
有沒有其他方法可以解決頭文件的問題?
現在我找到了clang的config.h文件.負責包含文件的兩個變量在文件中如下,其當前值如下:
/* Relative directory for resource files */
#define CLANG_RESOURCE_DIR ""
/* Directories clang will search for headers */
#define C_INCLUDE_DIRS "/usr/include/i386-linux-gnu:/usr/include/i686-linux-gnu:/usr/include"
但我不知道為了讓它發揮作用我應該取代什么價值.
這些是否可以完全重新配置clang?
總結
以上是生活随笔為你收集整理的clang编译c语言,clang没有编译c程序?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: (05)使用kafka脚本发送消息和接收
- 下一篇: 原生态JS实现banner图的常用所有功