C ++程序不能用Clang和visual Studio 2010 Express编译 [英] C++ program not compiling with Clang and visual Studio 2010 Express

查看:353
本文介绍了C ++程序不能用Clang和visual Studio 2010 Express编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用visual c ++ 2010 express编译本教程中描述的源代码。
http://kevinaboos.wordpress.com/2013 / 07/23 / clang-tutorial-part-ii-libtooling-example /

I'm trying to compile the source code as described in this tutorial with visual c++ 2010 express. http://kevinaboos.wordpress.com/2013/07/23/clang-tutorial-part-ii-libtooling-example/

完整的源代码在这里。
https://github.com/kevinaboos/LibToolingExample

The full source code is over here. https://github.com/kevinaboos/LibToolingExample

我已经使用此链接中提供的可执行文件来安装LLVM。
由于格式问题,我无法发布完整的错误消息。但
我会尽量提供尽可能多的信息,我可以。
当我试图构建解决方案时,我得到以下错误: -

I have used the executable provided in this link to install LLVM. I can't post the complete error message due to formatting issues. But I will try to give as much information as I can. When I'm trying to build the solution , I get the following errors :-


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 ++应用程序的新手。请帮助。

I'm using windows-7 64 bit. I've linked the header files and libraries by changing the project properties. I'm new to building c++ applications. Please help.

推荐答案

对于MSVC 2012生成错误,找到了解决方案这里

For MSVC 2012 build error, found a solution here

根据帮助文档,但尚不支持异常和SEH。您必须禁用它。

According to Clang documentation, Exceptions and SEH are not supported yet. You have to disable it.

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

To disable exception in Visual Studio, please open Project Properties and go to C/C++, Preprocessor, then add _HAS_EXCEPTIONS=0 to Preprocessor Definitions.

这篇关于C ++程序不能用Clang和visual Studio 2010 Express编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆