在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?