关于windows10环境下cmake指令报错问题Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.

发布于

我是在网吧的机子上git clone的,工程所在的目录是C:\Users\Administrator\GameEngine\Piccolo

(报错信息在最后)

按照网上的帖子搞了老半天解决不了

后来偶然发现是这个文件夹有毒(才疏学浅我也不知道原因)

我在桌面创了个空文件夹重新clone 然后cmake就成功了。。。。。。

======================

输入完cmake -S . -B build后控制台输出如下:

-- The CXX compiler identification is MSVC 19.29.30152.0

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - failed

-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi

o/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe

-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi

o/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - broken

CMake Error at C:/Program Files/CMake/share/cmake-3.20/Modules/CMakeTestCXXCompi

ler.cmake:59 (message):

 The C++ compiler


   "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC

/14.29.30133/bin/Hostx64/x64/cl.exe"


 is not able to compile a simple test program.


 It fails with the following output:


   Change Dir: C:/Users/Administrator/GameEngine/Piccolo/build/CMakeFiles/CMake

Tmp


   Run Build Command(s):nmake -f Makefile /nologo cmTC_22c12\fast &&   "C:\Prog

ram Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133

\bin\Hostx64\x64\nmake.exe"  -f CMakeFiles\cmTC_22c12.dir\build.make /nologo -L

                CMakeFiles\cmTC_22c12.dir\build

   Building CXX object CMakeFiles/cmTC_22c12.dir/testCXXCompiler.cxx.obj

       "C:\Program Files\CMake\bin\cmake.exe" -E cmake_cl_compile_depends --dep

-file=CMakeFiles\cmTC_22c12.dir\testCXXCompiler.cxx.obj.d --working-dir=C:\Users

\Administrator\GameEngine\Piccolo\build\CMakeFiles\CMakeTmp --filter-prefix="注

意: 包含文件:  " -- "C:\Program Files (x86)\Microsoft Visual Studio\2019\Communi

ty\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe" @C:\Users\Administrator\App

Data\Local\Temp\nm4B5F.tmp

   testCXXCompiler.cxx

   Linking CXX executable cmTC_22c12.exe

       "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFile

s\cmTC_22c12.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- "C:\Program Files

(x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Host

x64\x64\link.exe" /nologo @CMakeFiles\cmTC_22c12.dir\objects1.rsp @C:\Users\Admi

nistrator\AppData\Local\Temp\nm4C3B.tmp

   RC Pass 1: command "rc /fo CMakeFiles\cmTC_22c12.dir/manifest.res CMakeFiles

\cmTC_22c12.dir/manifest.rc" failed (exit code 0) with the following output:

   系统找不到指定的文件。NMAKE : fatal error U1077: “"C:\Program Files\CMake\bi

n\cmake.exe"”: 返回代码“0xffffffff”

   Stop.

   NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\

2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\nmake.exe"”: 返回代码“0

x2”

   Stop.






 CMake will not be able to correctly generate this project.

Call Stack (most recent call first):

 CMakeLists.txt:3 (project)



-- Configuring incomplete, errors occurred!

See also "C:/Users/Administrator/GameEngine/Piccolo/build/CMakeFiles/CMakeOutput

.log".

See also "C:/Users/Administrator/GameEngine/Piccolo/build/CMakeFiles/CMakeError.

log".


评论
收藏 1