Jesus
Jesus

Reputation: 11

Why do I get an error when creating an LLVM.sln file with cmake?

I try to build Clang on Windows as the guide told in http://clang.llvm.org/get_started.html However,an error occurs when I try to create an LLVM.sln file with cmake:

CMake Warning at CMakeLists.txt:48 (message):
  Visual Studio generators use the x86 host compiler by default, even for
  64-bit targets.  This can result in linker instability and out of memory
  errors.  To use the 64-bit host compiler, pass -Thost=x64 on the CMake
  command line.


CMake Error at CMakeLists.txt:54 (project):

Failed to run MSBuild command:

  MSBuild.exe

to get the value of VCTargetsPath:

Configuring incomplete, errors occurred!
See also "H:/build/CMakeFiles/CMakeOutput.log".

How to solve this problem and generate a Visual Studio 2017 file?

enter image description here

Upvotes: 1

Views: 654

Answers (2)

Imran Khan
Imran Khan

Reputation: 11

  • go to Uninstall center (Control Panel\Programs\Programs and Features)
  • click on "Microsoft Visual studio community 2015 with updates"
  • click on CHANGE
  • a Visual studio panel will open, Click on REPAIR tab and wait for 15mints, and restart the system. this will fix the Cmake error at MSBuild.exe

Upvotes: 1

Andreas Haferburg
Andreas Haferburg

Reputation: 5510

  1. "Failed to run MSBuild command" indicates that CMake can't find Visual Studio at all, and probably means that you selected the wrong version of Visual Studio in the dropdown. It might mean that you didn't install Visual Studio correctly.

  2. The warning you're seeing is not an error, just a warning. Since CMake is stupid, and doesn't know that it was run from within the GUI, the error message is non-helpful, as is tradition in the world of building C/C++. In order to fix it, you delete the cache, and then click on 'Generate' again. Then you can specify in a text field the argument to -T, where you enter "host=x64".

Upvotes: 0

Related Questions