当前位置:网站首页>Qt工程报错:-1: error: Cannot run compiler ‘clang++‘. Output:mingw32-make.exe
Qt工程报错:-1: error: Cannot run compiler ‘clang++‘. Output:mingw32-make.exe
2022-06-23 07:00:00 【妙为】
系列文章目录
文章目录
前言
在网上下载Qt工程中在本机中,用自己的QtCreator经常会遇到各种报错
“QMAKE_CXXFLAGS+=–target=i686-w64-mingw32” “QMAKE_LFLAGS+=–target=i686-w64-mingw32”
Info: creating stash file E:\QtExercise\QtReadWriteXml\QtXmlDom\build-QtXmlDom-Qt_5_12_9_msvc2017_64_64bit-Debug.qmake.stash
10:32:20: 进程"D:\Qt\Qt5.12.9\5.12.9\msvc2017_64\bin\qmake.exe"正常退出。
10:32:20: 无法启动进程"mingw32-make.exe" -f E:/QtExercise/QtReadWriteXml/QtXmlDom/build-QtXmlDom-Qt_5_12_9_msvc2017_64_64bit-Debug/Makefile qmake_all
Error while building/deploying project QtXmlDom (kit: Qt 5.12.9 (msvc2017_64) 64bit)
The kit Qt 5.12.9 (msvc2017_64) 64bit has configuration issues which might be the root cause for this problem.
When executing step “qmake”
10:32:21: Elapsed time: 00:03.



一、报错原因
我大概总结了以下三种原因:
1.原工程是使用MinGW32/64编译器生成的
2.原工程是使用MSVC2015~msvc2019编译器生成的
3.原工程使用lang编译器生成的
其中clang编译器可能有些小伙伴比较陌生
Clang编译器是由APPLE公司的编译器大牛Chris Lattner主导下编写的,其目标是替换大名鼎鼎的GCC编译器;从XCODE4开始,也就是 Mac OS X 10.6版本系统上,Apple 宣布停止更新GCC编译器,这样GCC停留在GCC4.2版本,并建议大家使用LLVM Compiler 2.0(LLVM-Clang),该版本完全支持C++/ Objective-C++,并提供libc++库来支持新的C++ standard(C++0x标准),而GCC/LLVM-GCC支持的是GCC标准库libstdc++;
另外,由于LLVM-Clang的优秀设计,Android NDK从r11开始建议大家切换到clang。并且把GCC标记为deprecated(弃用),将GCC版本锁定在GCC 4.9不再更新;Android NDK从r13起,默认使用Clang进行编译。但是暂时也没有把GCC删掉,Google考虑 libc++(LLVM-Clang的c++标准库)还不够稳定; Android NDK 在 r17 中宣称不再支持 GCC 并在后续的 r18 中删掉 GCC。现在GCC主战场只剩Linux跟部分Windows应用软件开发。
二、解决办法
1.首先我们在安装Qt的时候,记得勾选msvc,MinGW这些编译器,由于我是在windows下开发,所有只选择了msvc,MinGW编译器
2.QtCreator配置


配置成对应的msvc或者MinGW编译器
参考
边栏推荐
- MySQL (V) - locks and transactions
- Ntu-rgbd data set download and data format analysis
- Unity图片加载和保存
- HCIP之路第八次实验
- char和varchar区别
- WPS for thesis writing installs MathType plug-in to write mathematical formulas
- [深度学习][原创]如何不用yolov5权重或者模型进行目标检测和绘制map等参数图
- Design of temperature detection and alarm system based on 51 single chip microcomputer
- 3DMAX plug-in development environment configuration and fileexport and utilities template testing
- leetcode210. 课程表 II 207. 课程表 拓扑排序 dfs bfs
猜你喜欢
随机推荐
MySQL(四) — MySQL存储引擎
char和varchar区别
Tp6 installation expansion
Heterogeneous transaction scenario interaction process and consistency assurance
在线文本过滤小于指定长度工具
Sstable details
Data types in tensorflow
codeforce 158B Taxi
Wechat multiplayer chat and Roulette Games (websocket Implementation)
Unity picture loading and saving
leetcode210. Schedule II 207 Curriculum topology sorting DFS BFS
论文伪代码规范,伪代码在线编辑器,
用户态和内核态
Cirium has gradually become the standard for airlines' carbon dioxide emission reporting
Online text filter less than specified length tool
【云计算赛项】职业技能竞赛--容器开发部分例题Pig快速开发框架
Chain tour airship development farmers' world chain tour development land chain tour development
[Laoke] how should ordinary people learn technology?
Eureka service registration and discovery
3DMAX plug-in development environment configuration and fileexport and utilities template testing









