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

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

Full source code is here. https://github.com/kevinaboos/LibToolingExample

I used the executable file provided in this link to install LLVM. I cannot post the full error message due to formatting problems. But I will try to provide as much information as possible. When I try to build a 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 am using windows-7 64 bit. I linked the header files and libraries by changing the project properties. I am new to creating C ++ applications. Please, help.

+6
source share
1 answer

For MSVC 2012 build error found solution here

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

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

+10
source

Source: https://habr.com/ru/post/970793/


All Articles