在VS中CMake生成出现报错 RC Pass 1: command “rc /foCMakeFiles\cmTC_2347.dir/manifest.res CMakeFiles\cmTC_2347

在VS2019、2022上CMake生成时报错,如下图所示。

RC Pass 1: command "rc /foCMakeFiles\cmTC_2347.dir/manifest.res CMakeFiles\cmTC_2347.dir/manifest.rc" failed (exit code 0) with the following output:
系统找不到指定的文件。
ninja: build stopped: subcommand failed.

尝试了网友分享的多种方法,有成功的也有失败的,这里做一个记录。
在这里插入图片描述
尝试方法一
https://blog.youkuaiyun.com/Akutamatsu/article/details/107552659#comments_29609467
将需要引用的系统库路径添加到环境变量(未成功)
在这里插入图片描述
尝试方法二
https://gitlab.kitware.com/cmake/cmake/-/issues/19054
方法要求在visual studio中安装了所有的C++工具(未成功)。
在这里插入图片描述
尝试方法三
https://developer.aliyun.com/article/1416646
将CMake生成器由Ninja改成Unix Makefiles,但这样的改变只适用在Linux中,在Windows系统中会出现以下错误。
在这里插入图片描述
最后将生成器改为Visual Studio 16 2019 Win64,利用本地的编译器就可以成功编译CMake了(成功)。
在这里插入图片描述
总结
最后成功解决了问题,但对解决方法还是不够了解,说白了就是稀里糊涂的把问题解决了,希望看到看到这里的大佬可以指点指点,多谢多谢!!!(清楚问题原因后会再做补充)

D:\Mysoftware\share\cmake-4.0\Modules\CMakeTestCXXCompiler.cmake:73: error: The C compiler "D:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/x86_amd64/cl.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: 'C:/Users/HeuCi/AppData/Local/Temp/QtCreator-eCzzSo/qtc-cmake-NkNrRaXM/CMakeFiles/CMakeScratch/TryCompile-nntpeh' Run Build Command(s): D:/Mysoftware/bin/cmake.exe -E env VERBOSE=1 nmake -f Makefile /nologo cmTC_91b2c\fast "D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f CMakeFiles\cmTC_91b2c.dir\build.make /nologo -L CMakeFiles\cmTC_91b2c.dir\build Building CXX object CMakeFiles/cmTC_91b2c.dir/testCXXCompiler.cxx.obj D:\Mysoftware\bin\cmake.exe -E cmake_cl_compile_depends --dep-file=CMakeFiles\cmTC_91b2c.dir\testCXXCompiler.cxx.obj.d --working-dir=C:\Users\HeuCi\AppData\Local\Temp\QtCreator-eCzzSo\qtc-cmake-NkNrRaXM\CMakeFiles\CMakeScratch\TryCompile-nntpeh --filter-prefix="娉ㄦ剰: 鍖呭惈鏂囦欢: " -- "D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe" @C:\Users\HeuCi\AppData\Local\Temp\nm4879.tmp testCXXCompiler.cxx Linking CXX executable cmTC_91b2c.exe D:\Mysoftware\bin\cmake.exe -E vs_link_exe --msvc-ver=1900 --intdir=CMakeFiles\cmTC_91b2c.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- "D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe" /nologo @CMakeFiles\cmTC_91b2c.dir\objects1.rsp @C:\Users\HeuCi\AppData\Local\Temp\nm48B8.tmp Visual Studio Incremental Link with embedded manifests Create CMakeFiles\cmTC_91b2c.dir/manifest.rc Create empty: CMakeFiles\cmTC_91b2c.dir/embed.manifest RC Pass 1: rc /fo CMakeFiles\cmTC_91b2c.dir/manifest.res CMakeFiles\cmTC_91b2c.dir/manifest.rc RC Pass 1: command "rc /fo CMakeFiles\cmTC_91b2c.dir/manifest.res CMakeFiles\cmTC_91b2c.dir/manifest.rc" failed (exit code 0) with the following output: no such file or directoryNMAKE : fatal error U1077: 鈥淒:\Mysoftware\bin\cmake.exe鈥 杩斿洖浠g爜鈥x
06-27
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值