CMake does not find Visual C++ compiler

前端 未结 27 2199
小鲜肉
小鲜肉 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:35

    Look in the Cmakelists.txt if you find ARM you need to install C++ for ARM and as well vcvarsall.bat use for ARM bin folder.

    It's these packages:

    C++ Universal Windows Platform for ARM64 "Not Required"

    Visual C++ Compilers and libraries for ARM "Not Required"

    Visual C++ Compilers and libraries for ARM64 "Very Likely Required"

    Required for finding Threads on ARM 
    enable_language(C) 
    enable_language(CXX)
    

    Then the problems might disappear:

    No CMAKE_C_COMPILER could be found.

    No CMAKE_CXX_COMPILER could be found.

    If above does not resolve your problem?

    Optionally you can remove the options C and CXX in cmakelists.txt by setting # infront of where the enable_language(C) is. And avoid Android ARM processor compilation.

    0 讨论(0)
  • 2020-11-29 19:36

    In my case there was an environment variable set which was the reason for this error. The problem was solved after deleting cxx_flags from the environment variables.

    0 讨论(0)
  • 2020-11-29 19:36

    I got this problem with CMake 3.12.1, after an update of Visual Studio 2017. I simply re-ran CMake and it worked.

    0 讨论(0)
提交回复
热议问题