C++ Could not find compiler set in environment variable RC

Viewed 1616

I'm trying to compile a C++ program with clang using cmake, but I get the following error:

> CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/CMakeDetermineRCCompiler.cmake:20 (message):
  Could not find compiler set in environment variable RC:

>  C:\Program Files (x86)\Microsoft Visual
  Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.12/Modules/Platform/Windows-MSVC.cmake:380 (enable_language)
  C:/Program Files/CMake/share/cmake-3.12/Modules/Platform/Windows-Clang.cmake:16 (__windows_compiler_msvc)
  C:/Program Files/CMake/share/cmake-3.12/Modules/Platform/Windows-Clang-C.cmake:2 (__windows_compiler_clang)
  C:/Program Files/CMake/share/cmake-3.12/Modules/CMakeCInformation.cmake:48 (include)
  CMakeLists.txt:18 (project)

What could be the problem? Searched all the internet, but didn't find an answer. Thanks in advance!

1 Answers

I ran into this exact error message and ended up resolving this by running my cmake command from a developer command prompt. For visual studio 2017, this is done by running Common7\Tools\VsDevCmd.bat. via standard command prompt. This is usually found in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community (This location depends on your VS install).

Related