C++ 程序无法使用 Clang 和 Visual Studio 2010 Express 进行编译

2024-03-15

我正在尝试使用 Visual C++ 2010 Express 编译本教程中所述的源代码。http://kevinaboos.wordpress.com/2013/07/23/clang-tutorial-part-ii-libtooling-example/ http://kevinaboos.wordpress.com/2013/07/23/clang-tutorial-part-ii-libtooling-example/

完整的源代码在这里。https://github.com/kevinaboos/LibToolingExample 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 http://www.reddit.com/r/programming/comments/2a4o7x/llvm_project_blog_clangllvm_on_windows_update/

根据铿锵文档 http://clang.llvm.org/docs/MSVCCompatibility.html、异常和SEH尚不支持。你必须禁用它。

要在 Visual Studio 中禁用异常,请打开“项目属性”并转到“C/C++”、“预处理器”,然后添加_HAS_EXCEPTIONS=0到预处理器定义。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

C++ 程序无法使用 Clang 和 Visual Studio 2010 Express 进行编译 的相关文章

随机推荐