I fail to use the command line to configure, reporting errors as “The C compiler identification is unknown and The CXX compiler identification is unknown”.
But for the same project, it is successful when using the cmake-gui. My cmake version is 3.20.4.
report information like:
Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042.
The C compiler identification is MSVC 19.16.27045.0
The CXX compiler identification is MSVC 19.16.27045.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: D:/Program Files/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: D:/Program Files/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
operation system is Windows-10.0.19042
Found OpenMP_C: -openmp (found version “2.0”)
Found OpenMP_CXX: -openmp (found version “2.0”)
Found OpenMP: TRUE (found version “2.0”)
Anyone could help? I don’t know why there is a difference in my vs2017 build and how to solve it in command-line way.
I try to add the x86 compiler path “D:\Program Files\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x86” to the system environment path, it still has the same error.
Actually, I don’t know how the cmake-gui works and why it chooses the x86/32bits option. And how it detects the complier information of:
The C compiler identification is MSVC 19.16.27045.0
The CXX compiler identification is MSVC 19.16.27045.0
I have local search results for the cl.exe as shown below…
While I try the cmake command in the same shell, it prompt the same error…
– Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042.
– The C compiler identification is unknown
– The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_CXX_COMPILER could be found.
Hello @StevenWang we ended up finding a solution over on this discourse. Try temporarily minimizing your PATH variable to see if that helps as shown in that thread.