CMake Compiler Error on Windows Using Visual Studio 2017


Solutions

If you're like me, you've run into the following set of errors when trying to use CMake on Windows and especially when trying to compile Python code:

-- Building for: NMake Makefiles
-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:131 (project):
  The CMAKE_CXX_COMPILER:

    cl

  is not a full path and was not found in the PATH.

  To use the NMake generator with Visual C++, cmake must be run from a shell
  that can use the compiler cl from the command line.  This environment is
  unable to invoke the cl compiler.  To fix this problem, run cmake from the
  Visual Studio Command Prompt (vcvarsall.bat).

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:131 (project):
  The CMAKE_C_COMPILER:

    cl

  is not a full path and was not found in the PATH.

  To use the NMake generator with Visual C++, cmake must be run from a shell
  that can use the compiler cl from the command line.  This environment is
  unable to invoke the cl compiler.  To fix this problem, run cmake from the
  Visual Studio Command Prompt (vcvarsall.bat).

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

Read on for instructions on how to get past this error...

The solution is to modify the installation of Visual Studio 2017 and install a specific individual component.

  1. Go to Add or Remove Programs and Modify your Visual Studio 2017 installation
  2. Click the Individual Components heading at the top
  3. Under Compilers, build tools, and runtimes check the Visual C++ tools for CMake (see image below)
    • Allow it to include any other necessary dependency items for CMake tools
  4. Click the Modify button to have it update the installation
  5. When installation is done, if you have a command prompt shell open still you will want to restart it.
  6. Try your CMake command again. It should work!

Modify Visual Studio 2017 to include CMake Tools

Tag: microsoft visual studio python cmake compiler

Share It!

Trackback

Trackback URL for this entry: https://www.grimadmin.com/trackback.php/cmake-compiler-error-on-windows-using-visual-studio-2017

No trackback comments for this entry.

We keep your paper secured from plagiarism and any quality issues making quality and plagiarism check. Your satisfaction is our topmost priority that is why we do everything possible to make sure the highest level of the writing homework help we deliver. We promise to finish your order before a specified deadline and deliver it firmly to your email. We never sell rewritten or recycled academic papers. To ensure that your paper will be perfect, we hire native-speaking writers with master’s and Ph.D. degrees, so a paper you submit meets all your requirements.
Here at www.theprogrammingassignmenthelp.com, we can provide expert homework writing help that can benefit you throughout your academic and professional career. Simply submit the instructions and details of your work to our homework help writing specialists who will review your materials and provide advice and feedback that will allow you to enhance the overall quality of your Database assignment work.
Whether you are a first-year college student or a Ph.D. candidate, we have well-qualified homework help writers and competent editors to deliver the best Do My Homework Services to you. We know that students have a busy college life, and we aim to make your life easier and give you more free time. Let our homework help experts do the tricky and complicated homework writing for you. We have a big team of professional homework helpers who have degrees in various academic disciplines and can provide you with the best kind of academic writing help you need.

https://www.theprogrammingassignmenthelp.com/database-assignment-help

#AssignmentHelpUSA #assignmenthelpUK #DatabaseAssignmenthelp #assignmenthelpcanada #HomeworkHelpUSA #DatabaseHomeworkHelp #HomeworkHelpAustralia #HomeworkHelpCanada #DatabaseHelpMalaysia #AsisgnmentHelpUAE #HomeworkHelpUAE