C++ program not compiling with Clang and visual Studio 2010 Express

坚强是说给别人听的谎言 提交于 2019-12-04 09:52:10

问题


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/

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

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

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.


回答1:


For MSVC 2012 build error, found a solution here

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

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



来源:https://stackoverflow.com/questions/24197773/c-program-not-compiling-with-clang-and-visual-studio-2010-express

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!