首先qt5.11存在代码缺陷,需修改代码才能编译成功,make后根据报错修改代码即可,后面列出了遇到的报错参考网址(百度)
qt-everywhere-src-5.11.1\qtbase\src\corelib\global\qconfig-bootstrapped.h
qt-everywhere-src-5.11.1\qtserialbus\src\plugins\canbus\socketcan\socketcanbackend.cpp
qt-everywhere-src-5.11.1\qtbase\src\corelib\io\qfilesystemengine_unix.cpp
qt-everywhere-src-5.11.1\qtbase\src\corelib\global\qrandom.cpp
#xcb相关 sudo apt-get install -y libx11-xcb-dev sudo apt-get install -y libxkbcommon-dev sudo apt-get install -y libxcb* sudo apt-get install -y libx11* #opengel相关 sudo apt-get install -y libegl1-mesa-dev libglu1-mesa-dev #qtwebengine相关 sudo apt-get install -y gperf bison flex sudo apt-get install -y pkg-config
sudo apt-get install -y python
#其他 sudo apt install libwayland-dev sudo apt-get install g++ #其他可能依赖(不报错不需要) #apt-get install bison build-essential gperf flex ruby python libasound2-dev libbz2-dev libcap-dev libcups2-dev libdrm-dev libegl1-mesa-dev libgcrypt11-dev libnss3-dev libpci-dev libpulse-dev libudev-dev libxtst-dev gyp ninja-build libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libicu-dev #解压: tar -xvf qt-everywhere-src-5.11.1.tar.xz #配置 mkdir qt_build cd qt_build sudo ../configure -prefix /opt/Qt5.11.1 -mp -recheck-all -opensource -confirm-license -skip qtlocation -nomake examples -nomake tests -qt-xcb -system-xcb -qpa xcb #编译安装 sudo make -j 8 && make install
查看编译后的qmake版本
可在麒麟商店下载qt creator,配置:
参考:
https://blog.csdn.net/weixin_44062779/article/details/135043293
https://blog.csdn.net/qq_36939187/article/details/127632515
编译报错:
https://blog.csdn.net/splendid_you/article/details/129055256
https://bugreports.qt.io/browse/QTBUG-69843
https://blog.csdn.net/weixin_42948436/article/details/130109050