赞
踩
使用cmake-gui生成vs工程,进行configure时,报错信息如下:
CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/CMakeDetermineRCCompiler.cmake:25 (message):
Could not find compiler set in environment variable RC:
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\.
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.18/Modules/Platform/Windows-MSVC.cmake:437 (enable_language)
C:/Program Files/CMake/share/cmake-3.18/Modules/Platform/Windows-MSVC.cmake:421 (__windows_compiler_msvc_enable_rc)
C:/Program Files/CMake/share/cmake-3.18/Modules/Platform/Windows-MSVC-C.cmake:5 (__windows_compiler_msvc)
C:/Program Files/CMake/share/cmake-3.18/Modules/CMakeCInformation.cmake:48 (include)
CMakeLists.txt:11 (project)
看报错日志,找不到环境变量RC设置的编译器,输出的RC变量值为空,所以原因是RC变量没有设置
那么为什么没有设置RC变量呢?我试了重装cmake, 重装vs,重新下载需要cmake的代码,还是报错。
后来看到一篇博客,博主是通过命令行传入RC变量:
cmake -G Ninja -B build .
于是我试了下在CMakeDetermineRCCompiler.cmake
文件中直接设置RC变量值为:Ninja
清理cmake缓存,然后重新configure就正常运行了。。
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。