我正在尝试使用 Visual C++ 2010 Express 编译本教程中所述的源代码。 http://kevinaboos.wordpress.com/2013/07/23/clang-tutorial-part-ii-libtooling-example/
完整的源代码在这里。 https://github.com/kevinaboos/LibToolingExample
我已使用此链接中提供的可执行文件来安装 LLVM。 由于格式问题,我无法发布完整的错误消息。但 我会尽量提供尽可能多的信息。 当我尝试构建解决方案时,出现以下错误:-
argument unused during compilation warnings. C:\Program Files (x86)\LLVM\include\llvm/Support/Compiler.h(57,1): error : LLVM requires at least MSVC 2012. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocnum(228,53): error : definition of dllimport static field not allowed C:\Program Files (x86)\LLVM\include\llvm/ADT/IntrusiveRefCntPtr.h(26,9): fatal error : 'atomic' file not found
我使用的是 windows-7 64 位。 我通过更改项目属性链接了头文件和库。 我是构建 C++ 应用程序的新手。请帮忙。
最佳答案
对于 MSVC 2012 构建错误,已找到解决方案 here
根据 Clang documentation , Exceptions 和 SEH 尚不支持。您必须禁用它。
要在 Visual Studio 中禁用异常,请打开项目属性并转到 C/C++、预处理器,然后将 _HAS_EXCEPTIONS=0 添加到预处理器定义。
关于C++ 程序不使用 Clang 和 visual Studio 2010 Express 编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24197773/