CMake does not find Visual C++ compiler

前端 未结 27 2385
小鲜肉
小鲜肉 2020-11-29 18:51

After installing Visual Studio 2015 and running CMake on a previous project, CMake errors stating that it could not find the C compiler.

The C compiler ident         


        
27条回答
  •  鱼传尺愫
    2020-11-29 19:25

    A couple of tips:

    • Try to set the path manually by checking 'advanced' and modifying CMAKE_LINKER and CMAKE_MAKE_PROGRAM
    • Delete the cache - in the CMake with GUI go to: File → Delete Cache.

    My problem was a combination of previously stated: I have set the compiler version to 15 instead of 14 and when corrected, I had to delete the cache.

    I also started the Visual Studio command prompt as an administrator and from there I ran the cmake-gui.exe

    Then everything worked as it was supposed to.

提交回复
热议问题