我按照http://clang.llvm.org/get_started.html的说明进行操作
我用 MSVC 2010 编译了最新的 llvm 和 clang 主干。现在我可以用 Clang 编译简单的程序,但是当我试图编译这个程序时,我得到了很多错误。这是程序:
#include <algorithm>
int main(){ return 0; }
以下是一些错误:
In file included from hello.cpp:1:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include\algorithm:6:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include\memory:987:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include\intrin.h:24:
In file included from H:/LLVM/build/bin/Debug/../lib/clang/3.3/include\immintrin.h:32:
In file included from H:/LLVM/build/bin/Debug/../lib/clang/3.3/include\xmmintrin.h:988:
H:/LLVM/build/bin/Debug/../lib/clang/3.3/include\emmintrin.h:1384:22: error: expected expression
return (__m128)__in;
^
H:/LLVM/build/bin/Debug/../lib/clang/3.3/include\emmintrin.h:1390:23: error: expected expression
return (__m128i)__in;
^
H:/LLVM/build/bin/Debug/../lib/clang/3.3/include\emmintrin.h:1396:23: error: expected expression
return (__m128d)__in;
^
Clang 的完整输出:http: //pastebin.com/qi87K8qr
Clang 尝试使用 MSVC 标头,但它不起作用。也许我应该改用 libc++ 或 libstdc++,但是该怎么做呢?
注意我对预编译的 clang 二进制文件不感兴趣