我对Clang很陌生。
我使用这篇文章开始使用预编译的Clang3.5.0和Visual 2012。
当我试图编译以下代码时:
// hello.c
#include <stdio.h>
int main() {
printf("hello world\n");
return 0;
}
像这样
C:\..> clang -c hello.c -emit-llvm -o hello.bc
我有个错误:
hello.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^
1 error generated.
如何使预编译的Clang查看visual studio标头?
发布于 2014-12-25 02:49:35
gmlacrosse是对的。我需要将include目录添加到命令行中。
-I
命令行开关解决了这个问题:
C:\..> clang -c hello.c -emit-llvm -o hello.bc -I "c:\Program Files\Microsoft Visual Studio 11.0\VC\include"
https://stackoverflow.com/questions/27638069
复制相似问题