项目场景:
提示:这里简述项目相关背景:
项目新电脑环境配置 Qt+MSVC2017_64bit +Cmake新建项目编译出错
问题描述
提示:这里描述项目中遇到的问题:
Qt+MSVC2017_64bit +Cmake新建项目编译出错
Running C:\Program Files\CMake\bin\cmake.exe C:/Users/gh3/Documents/untitled "-GCodeBlocks - NMake Makefiles JOM" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_CXX_COMPILER:STRING=C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe" "-DCMAKE_C_COMPILER:STRING=C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe" "-DCMAKE_PREFIX_PATH:STRING=C:/Qt/Qt5.14.2/5.14.2/msvc2017_64" "-DQT_QMAKE_EXECUTABLE:STRING=C:/Qt/Qt5.14.2/5.14.2/msvc2017_64/bin/qmake.exe" in C:\Users\gh3\AppData\Local\Temp\QtCreator-QGCZcT\qtc-cmake-wTmykxEw.
CMake Deprecation Warning:
Support for "Extra Generators" like
CodeBlocks
is deprecated and will be removed from a future version of CMake. IDEs may
use the cmake-file-api(7) to view CMake-generated project build trees.
-- The CXX compiler identification is MSVC 19.16.27051.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.28/Modules/CMakeTestCXXCompiler.cmake:60 (message):
The C++ compiler
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: 'C:/Users/gh3/AppData/Local/Temp/QtCreator-QGCZcT/qtc-cmake-wTmykxEw/CMakeFiles/CMakeScratch/TryCompile-d5t8bj'
Run Build Command(s): "C:/Program Files/CMake/bin/cmake.exe" -E env VERBOSE=1 jom -f Makefile /nologo cmTC_23dd6\fast
no such file or directory
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
-- Configuring incomplete, errors occurred!
CMake process exited with exit code 1.
原因分析:
提示:这里填写问题的分析:
Detecting CXX compiler ABI info - failed
根据提示找到查找关键为什么会失败
解决方案:
提示:这里填写该问题的具体解决方案:
1.跟着网上添加了Qt的环境变量
问题不能解决
2.跟着问题查找,问题解决
实时保护,会自己改回来,但是新建项目已经没有影响。