当前位置:网站首页>Qtcreator+cmake compiler settings
Qtcreator+cmake compiler settings
2022-07-29 05:37:00 【longlongway2012】
QtCreator+CMake Compiler settings
One 、 background
Recently in contact with Qt Complete the verification of the cross platform scheme , In the use of Qt The compiler is , Discovery available CMake Carry out engineering construction , Unfortunately, it can't run anyway . Finally, through exploration , At last I found the reason , Organize them into articles , I hope it helps others .
Two 、 Wrong type
error 1
CMake Error: Generator: execution of make failed. Make command was: jom /nologo cmTC_28787\fast
error 2
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM
error 3
The system cannot find the specified file (ansi code )
perhaps
The system cannot find the specified file (utf8 code )
3、 ... and 、 Problem explanation
problem 1 : cmake In execution make Command failed ;
problem 2:cmake No build tools found Ninja The execution directory of , Need to set up CMAKE_MAKE_PROGRAM
problem 3: The system cannot find that the specified file has , Some compilers will output utf8 Coded garbled
Four 、QtCreator Next use CMake Specific configuration of
1 . establish QtWidget project :
2. Select build system as CMake
Select compiler type as vs2015

After creation , The system directly reports an error
Running C:\Program Files\CMake\bin\cmake.exe -S D:/dev/qt/project/CMakeTest -B C:/Users/Administrator/AppData/Local/Temp/QtCreator-OcBgPI/qtc-cmake-GWLriTJW in C:\Users\Administrator\AppData\Local\Temp\QtCreator-OcBgPI\qtc-cmake-GWLriTJW.
-- The CXX compiler identification is MSVC 19.0.24210.0
-- Detecting CXX compiler ABI info
CMake Error: Generator: execution of make failed. Make command was: jom -f Makefile /nologo cmTC_30d6b\fast &&
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: D:/vs2015/VC/BIN/amd64/cl.exe
CMake Error: Generator: execution of make failed. Make command was: jom -f Makefile /nologo cmTC_634f6\fast &&
-- Check for working CXX compiler: D:/vs2015/VC/BIN/amd64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeTestCXXCompiler.cmake:59 (message):
The C++ compiler
"D:/vs2015/VC/BIN/amd64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Administrator/AppData/Local/Temp/QtCreator-OcBgPI/qtc-cmake-GWLriTJW/CMakeFiles/CMakeTmp
Run Build Command(s):jom -f Makefile /nologo cmTC_634f6\fast && The system did not find the specified file
Generator: execution of make failed. Make command was: jom -f Makefile /nologo cmTC_634f6\fast &&
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/AppData/Local/Temp/QtCreator-OcBgPI/qtc-cmake-GWLriTJW/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Administrator/AppData/Local/Temp/QtCreator-OcBgPI/qtc-cmake-GWLriTJW/CMakeFiles/CMakeError.log".
CMake process exited with exit code 1.
Elapsed time: 00:01.
- Problem analysis
QtCreator Use CMake Build , The default compiler used is mingw and nmake Build system , For specific use, please refer to others blog.
So msvc compiler ,qtCeator Our support is not good enough , But it's not useless , You need to be familiar with qtCreator, Modify the order by yourself - resolvent
stay qtCreator Of manag kits Click the button in , Select... In the pop-up dialog box vs2015_x64, modify CMake Generator by visual studio 14 2015 x64
compile , Still reporting a mistake , Need to continue to modify . Click item -> Build settings panel , Delete In configuration item :
-GNMake Makefiles JOM

Delete all the settings in the four configuration items , Remember to clean it all , And then execute it again cmake structure , You can build success , But you can't compile code , Generate executable files .
It still needs to be changed , Open the project ->buil&run , Find the configuration :Build Steps for , take all Option to remove , Check ALL_BUILD You can compile the executable .
5、 ... and 、 Postscript
QtCreator Yes msvc The support is not complete , Many holes , Recommended or used Mingw To create cmake, No settings , It can be used directly .
边栏推荐
- ClickHouse学习(四)SQL操作
- Three handshakes and four waves for the interview summary
- uniapp组件之tab选项卡滑动切换
- ClickHouse学习(一)ClickHouse?
- Playwright实战案例之爬取js加密数据
- Wechat applet video upload component is directly uploaded to Alibaba cloud OSS
- Question swiping Madness - leetcode's sword finger offer58 - ii Detailed explanation of left rotation string
- The function of using wechat applet to scan code to log in to the PC web of the system
- 【剑指offer】— 详解库函数atoi以及模拟实现atoi函数
- 表格与表单相关知识点总结
猜你喜欢
随机推荐
AR虚拟增强与现实
Detailed explanation of exit interrupt
Basic use of redis
小程序中的DOM对象元素块动态排序
Summary of the first week
相对定位和绝对定位
Redirection and files
Camunda 1、Camunda工作流-介绍
牛客网编程题—【WY22 Fibonacci数列】和【替换空格】详解
Clickhouse learning (VI) grammar optimization
浅谈Servlet
Three handshakes and four waves for the interview summary
VIM editor use
On Paradigm
Detailed explanation of serial port communication
【C语言系列】— 字符串+部分转义字符详解+注释小技巧
rem与px与em异同点
Application of Huffman tree and Huffman coding in file compression
HCIA-R&S自用笔记(25)NAT技术背景、NAT类型及配置
用threejs 技术做游戏跑酷









