文章目录
一. 准备工作
- 下载qt5.9.9版本的源码
下载地址:https://download.qt.io/archive/qt/5.9/5.9.9/single/ //下载tar.gz包,使用迅雷下载,一个字。快
https://download.qt.io/official_releases/qtcreator/4.5/4.5.0/installer_source/ //将其中的两个包都下载下来
- win10搭建ftp服务
kylin上有自带的filezilla客户端,我们需要在下载的机器上搭建一个ftp服务,将下载好的文件传过去,我的下载文件系统是win
参考:win10开启ftp
- 将qt文件传到kylin上
- 将下载好的qt-source解压,查看README,进行环境检查,结果发现都是符合的(确保文档中提到版本的都满足)
二. 编译安装 qt-everywhere-opensource-src-5.9.9
- 将文件放在文件夹中不要再移动了
tlx@TLX001:~/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9$ pwd
/home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9
- 进行配置
tlx@TLX001:~/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9$ ./configure -prefix /home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/qtbase -opensource -nomake tests
输出如下:
tlx@TLX001:~/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9$ ./configure -prefix /home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/qtbase -opensource -nomake tests
+ cd qtbase
+ /home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/qtbase/configure -top-level -prefix /home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/qtbase -opensource -nomake tests
Creating qmake...
.........................................................................................Done.
Info: creating super cache file /home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/.qmake.super
Info: creating stash file /home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/.qmake.stash
This is the Qt Open Source Edition.
You are licensed to use this software under the terms of
the GNU Lesser General Public License (LGPL) version 3
or the GNU General Public License (GPL) version 2.
Type 'L' to view the GNU Lesser General Public License version 3 (LGPLv3).
Type 'G' to view the GNU General Public License version 2 (GPLv2).
Type 'y' to accept this license offer.
Type 'n' to decline this license offer.
Do you accept the terms of either license? y
Running configuration tests...
Checking for gold linker... yes
Checking for machine tuple... yes
Checking for valid makespec... yes
Checking for alloca() in alloca.h... yes
Checking for target architecture... x86_64
Checking for SSE2 instructions... yes
Checking for SSE3 instructions... yes
Checking for SSSE3 instructions... yes
Checking for SSE4.1 instructions... yes
Checking for SSE4.2 instructions... yes
Checking for AVX instructions... yes
Checking for AVX2 instructions... yes
Checking for AVX512 F instructions... yes
Checking for AVX512 BW instructions... yes
Checking for AVX512 CD instructions... yes
Checking for AVX512 DQ instructions... yes
Checking for AVX512 ER instructions... yes
Checking for AVX512 IFMA instructions... yes
Checking for AVX512 PF instructions... yes
Checking for AVX512 VBMI instructions... yes
Checking for AVX512 VL instructions... yes
Checking for C++14 support... yes
Checking for C++1z support... yes
Checking for pkg-config... yes
Checking for D-Bus >= 1.2... no
Checking for new dtags support... yes
Checking for F16C instructions... yes
Checking for D-Bus >= 1.2 (host)... yes
Checking for udev... yes
Checking for POSIX fallocate()... yes
Checking for precompiled header support... yes
Checking for symbol visibility support... yes
Checking for -Bsymbolic-functions support... yes
Checking for STL compatibility... yes
Checking for zlib... yes
Checking for clock_gettime()... yes
Checking for POSIX monotonic clock... yes
Checking for dlopen()... yes
Checking for eventfd... yes
Checking for GLib... no
Checking for POSIX iconv... yes
Checking for ICU... no
Checking for inotify... yes
Checking for SysV IPC... yes
Checking for ppoll()... yes
Checking for slog2... no
Checking for 64 bit atomics... yes
Checking for DoubleConversion... no
Checking for PCRE2... no
Checking for O_CLOEXEC... yes
Checking for working std::atomic for function pointers... yes
Checking for getaddrinfo()... yes
Checking for getifaddrs()... yes
Checking for IPv6 ifname... yes
Checking for OpenSSL Headers... yes
Checking for XCB >= 1.5 (core)... yes
Checking for atspi... no
Checking for Desktop OpenGL... yes
Checking for EGL... yes
Checking for XCB Xlib... yes
Checking for EGL on X11... yes
Checking for Broadcom EGL (Raspberry Pi)... no
Checking for EGLDevice... yes
Checking for KMS... yes
Checking for GBM... no
Checking for Mali EGL... no
Checking for Mali 2 EGL... no
Checking for i.Mx6 EGL... no
Checking for evdev... yes
Checking for FreeType... no
Checking for libinput... no
Checking for LinuxFB... yes
Checking for mtdev... no
Checking for OpenVG... no
Checking for default QPA platform... xcb
Checking for HarfBuzz... no
Checking for libjpeg... no
Checking for libpng... no
Checking for XCB (extensions)... no
Checking for tslib... no
Checking for X11 prefix... /usr
Checking for XCB GLX... yes
Checking for X11 session management... yes
Checking for XLib... yes
Checking for Xinput2... no
Checking for xkbcommon-x11 >= 0.4.1... no
Checking for XKB config root... /usr/share/X11/xkb
Checking for xkbcommon... no
Checking for CUPS... no
Checking for DB2 (IBM)... no
Checking for InterBase... no
Checking for MySQL... no
Checking for OCI (Oracle)... no
Checking for ODBC... no
Checking for PostgreSQL... no
Checking for SQLite (version 2)... no
Checking for TDS (Sybase)... no
Checking for Socket CAN... yes
Checking for Socket CAN FD... yes
Checking for Direct3D 12... no
Checking for SDL2... no
Checking for Assimp... no
Checking for Autodesk FBX... no
Checking for Wayland client library... yes
Checking for Wayland cursor library... yes
Checking for wayland-scanner... yes
Checking for DRM EGL Server... yes
Checking for libhybris EGL Server... no
Checking for Wayland EGL library... yes
Checking for XComposite... no
Checking for wayland-server... yes
Checking for BlueZ... no
Checking for sensorfw... no
Checking for Gypsy... no
Checking for WinRT Geolocation API... no
Checking for ALSA... no
Checking for GStreamer 1.0... no
Checking for GStreamer 0.10... no
Checking for Video for Linux... yes
Checking for OpenAL... no
Checking for PulseAudio >= 0.9.10... no
Checking for libresourceqt5... no
Checking for ALSA... no
Checking for embedded... no
Checking for PulseAudio >= 0.9.10... no
Checking for Python 2... /usr/bin/python2
Checking for system ninja... no
Checking for opus... no
Checking for re2... no
Checking for libwebp and libwebpdemux... no
Done running configuration tests.
Configure summary:
Build type: linux-g++ (x86_64, CPU features: mmx sse sse2)
Configuration: use_gold_linker sse2 sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples enable_new_dtags f16c largefile precompile_header shared rpath release c++11 c++14 c++1z concurrent dbus reduce_exports reduce_relocations stl
Build options:
Mode ................................... release
Optimize release build for size ........ no
Building shared libraries .............. yes
Using C++ standard ..................... C++1z
Using ccache ........................... no
Using gold linker ...................... yes
Using new DTAGS ........................ yes
Using precompiled headers .............. yes
Using LTCG ............................. no
Target compiler supports:
SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
AVX .................................. AVX AVX2 F16C
AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI
Build parts ............................ libs examples tools
Qt modules and options:
Qt Concurrent .......................... yes
Qt D-Bus ............................... yes
Qt D-Bus directly linked to libdbus .... no
Qt Gui ................................. yes
Qt Network ............................. yes
Qt Sql ................................. yes
Qt Testlib ............................. yes
Qt Widgets ............................. yes
Qt Xml ................................. yes
Support enabled for:
Using pkg-config ....................... yes
QML debugging .......................... yes
udev ................................... yes
Using system zlib ...................... yes
Qt Core:
DoubleConversion ....................... yes
Using system DoubleConversion ........ no
GLib ................................... no
iconv .................................. yes
ICU .................................... no
Logging backends:
journald ............................. no
syslog ............................... no
slog2 ................................ no
Using system PCRE2 ..................... no
Qt Network:
getaddrinfo() .......................... yes
getifaddrs() ........................... yes
IPv6 ifname ............................ yes
libproxy ............................... no
OpenSSL ................................ yes
Qt directly linked to OpenSSL ........ no
SCTP ................................... no
Use system proxies ..................... yes
Qt Gui:
Accessibility .......................... yes
FreeType ............................... yes
Using system FreeType ................ no
HarfBuzz ............................... yes
Using system HarfBuzz ................ no
Fontconfig ............................. no
Image formats:
GIF .................................. yes
ICO .................................. yes
JPEG ................................. yes
Using system libjpeg ............... no
PNG .................................. yes
Using system libpng ................ no
EGL .................................... yes
OpenVG ................................. no
OpenGL:
Desktop OpenGL ....................... yes
OpenGL ES 2.0 ........................ no
OpenGL ES 3.0 ........................ no
OpenGL ES 3.1 ........................ no
Session Management ..................... yes
Features used by QPA backends:
evdev .................................. yes
libinput ............................... no
INTEGRITY HID .......................... no
mtdev .................................. no
tslib .................................. no
xkbcommon-evdev ........................ no
QPA backends:
DirectFB ............................... no
EGLFS .................................. yes
EGLFS details:
EGLFS OpenWFD ........................ no
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS RCAR ........................... no
EGLFS EGLDevice ...................... yes
EGLFS GBM ............................ no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGL on X11 ........................... yes
LinuxFB ................................ yes
VNC .................................... yes
Mir client ............................. no
X11:
Using system-provided XCB libraries .. no
EGL on X11 ........................... yes
Xinput2 .............................. no
XCB XKB .............................. yes
XLib ................................. yes
XCB render ........................... yes
XCB GLX .............................. yes
XCB Xlib ............................. yes
Using system-provided xkbcommon ...... no
Qt Widgets:
GTK+ ................................... no
Styles ................................. Fusion Windows
Qt PrintSupport:
CUPS ................................... no
Qt Sql:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. no
OCI (Oracle) ........................... no
ODBC ................................... no
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. yes
Using system provided SQLite ......... no
TDS (Sybase) ........................... no
Qt SerialBus:
Socket CAN ............................. yes
Socket CAN FD .......................... yes
QtXmlPatterns:
XML schema support ..................... yes
Qt QML:
QML interpreter ........................ yes
QML network support .................... yes
Qt Quick:
Direct3D 12 ............................ no
AnimatedImage item ..................... yes
Canvas item ............................ yes
Support for Qt Quick Designer .......... yes
Flipable item .......................... yes
GridView item .......................... yes
ListView item .......................... yes
Path support ........................... yes
PathView item .......................... yes
Positioner items ....................... yes
ShaderEffect item ...................... yes
Sprite item ............................ yes
Qt Gamepad:
SDL2 ................................... no
Qt 3D:
Assimp ................................. yes
System Assimp .......................... no
Output Qt3D Job traces ................. no
Output Qt3D GL traces .................. no
Qt 3D GeometryLoaders:
Autodesk FBX ........................... no
Qt Wayland Drivers:
EGL .................................... yes
Raspberry Pi ........................... no
XComposite EGL ......................... no
XComposite GLX ......................... no
DRM EGL ................................ yes
libhybris EGL .......................... no
Qt Wayland Client ........................ yes
Qt Wayland Compositor .................... yes
Qt Bluetooth:
BlueZ .................................. no
BlueZ Low Energy ....................... no
Linux Crypto API ....................... no
Qt Sensors:
sensorfw ............................... no
Qt Quick Controls 2:
Styles ................................. Default Material Universal
Qt Quick Templates 2:
Hover support .......................... yes
Multi-touch support .................... yes
Qt Positioning:
Gypsy GPS Daemon ....................... no
WinRT Geolocation API .................. no
Qt Location:
Geoservice plugins:
OpenStreetMap ........................ yes
HERE ................................. yes
Esri ................................. yes
Mapbox ............................... yes
MapboxGL ............................. yes
Itemsoverlay ......................... yes
Qt Multimedia:
ALSA ................................... no
GStreamer 1.0 .......................... no
GStreamer 0.10 ......................... no
Video for Linux ........................ yes
OpenAL ................................. no
PulseAudio ............................. no
Resource Policy (libresourceqt5) ....... no
Windows Audio Services ................. no
DirectShow ............................. no
Windows Media Foundation ............... no
Qt WebEngine:
Embedded build ......................... no
Pepper Plugins ......................... yes
Printing and PDF ....................... yes
Proprietary Codecs ..................... no
Spellchecker ........................... yes
WebRTC ................................. yes
Using system ninja ..................... no
ALSA ................................... no
PulseAudio ............................. no
System libraries:
re2 .................................. no
ICU .................................. no
libwebp and libwebpdemux ............. no
Opus ................................. no
ffmpeg ............................... no
Note: Also available for Linux: linux-clang linux-icc
Note: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing.
Qt is now configured for building. Just run 'make'.
Once everything is built, Qt is installed.
You should NOT run 'make install'.
Note that this build cannot be deployed to other machines or devices.
Prior to reconfiguration, make sure you remove any leftovers from
the previous build.
在参考博客中提到还要支持zlib,我们看到在配置的输出信息中已经找到了zlib了,不错!
- 编译
机器配置较好的,用j8,记住,一定要用j8,不然编译到怀疑人生
make -j8
make完成,执行make install 却报错了,报了3个错:
cd qtmacextras/ && ( test -e Makefile || /home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/qtbase/bin/qmake -o Makefile /home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/qtmacextras/qtmacextras.pro ) && make -f Makefile install
make[1]: Entering directory '/home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/qtmacextras'
/home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/qtbase/bin/qmake -o Makefile qtmacextras.pro
Cannot read /home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/qtbase/mkspecs/linux-g++/qmake.conf: No such file or directory
Could not read qmake configuration file /home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/qtbase/mkspecs/linux-g++/qmake.conf.
Error processing project file: qtmacextras.pro
Makefile:202: recipe for target 'Makefile' failed
make[1]: *** [Makefile] Error 3
make[1]: Leaving directory '/home/tlx/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9/qtmacextras'
Makefile:119: recipe for target 'module-qtmacextras-install_subtargets' failed
make: *** [module-qtmacextras-install_subtargets] Error 2
- 重新进行配置
删除原来的qtbase里面内容,或者整个解压出来的包删除,重新解压
tlx@TLX001:~/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9$ ./configure -silent
tlx@TLX001:~/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9$ make -j8
tlx@TLX001:~/qt/sw/Qt5.9.9src/qt-everywhere-opensource-src-5.9.9$ sudo make install //普通用户这里一定要加sudo,否则会出现安装时权限不足
以上操作正确安装,没有报错
三.编译安装 qtcreator.7z
- 解压
tlx@TLX001:~/qt/sw$ 7z x qtcreator.7z
解压出来会有share bin lib libexec四个文件夹 ,对于这四个文件夹不知道怎么操作了。。。(无语吧)
开始运行编译,结果报错,没有webenginewidgets和webcchannel模块
四.上面的方法没有成功,看到有文章说可以直接安装run包,试试呗…真香~~~
sudo apt-get install gcc g++ make -y
$ chmod a+x qt-opensource-linux-x64-5.11.1.run
$ ./qt-opensource-linux-x64-5.11.1.run
完美解决。
参考:银河麒麟(Kylin)完整移植Qt5.9.2, 包含QCharts和QML等全部模块
ubuntu kylin 18.04 安装 Qt Creator 5.11