当前位置:网站首页>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 .
边栏推荐
- 167. Sum of two numbers II - enter an ordered array
- Topological ordering of a graph of water
- Day 1
- 关于局部变量
- Flask 报错 RuntimeError: The session is unavailable because no secret key was set.
- Together with digital people, digital space and XR platform, Alibaba cloud and its partners jointly build a "new vision"
- Storage category
- One dimensional array exercise
- [sword finger offer] - explain the library function ATOI and simulate the realization of ATOI function
- Clickhouse learning (x) monitoring operation indicators
猜你喜欢
随机推荐
uniapp组件之tab选项卡滑动切换
微信小程序视频上传组件直接上传至阿里云OSS
Detailed explanation of serial port communication
Day 2
[C language series] - storage of deep anatomical data in memory (II) - floating point type
Day 1
C language first level pointer
Alibaba cloud architect details nine trends in the game industry
Occt learning 002 - environment construction
Preemptive appointment | Alibaba cloud shadowless cloud application online conference appointment opens
ClickHouse学习(一)ClickHouse?
Redirection and files
uniapp之常用提示弹框
AR虚拟增强与现实
力扣994:腐烂的橘子(BFS)
Flask 报错 RuntimeError: The session is unavailable because no secret key was set.
浅谈范式
·Let's introduce ourselves to the way of programming·
167. Sum of two numbers II - enter an ordered array
Occt learning 001 - Introduction