Ubuntu 14.04系统下安装和编译QT 5.9.2库(桌面版/ARM嵌入式IMX6版)
最近要搞一個(gè)嵌入式項(xiàng)目,在I.MX6平臺(tái)上基于linux系統(tǒng)使用QT做界面開(kāi)發(fā),于是就研究了一下如何對(duì)QT 5.9.2版本的代碼進(jìn)行下載和編譯。同時(shí),因?yàn)榫幾g出來(lái)的程序不光要能在I.MX6嵌入式板子上運(yùn)行,還要能夠在桌面端運(yùn)行以方便調(diào)試,因此就涉及到桌面版和嵌入式版兩個(gè)版本,如下:
- pc桌面版,將其命名為qt-5.9.2-pc版本,用于在PC端模擬調(diào)試程序。
- imx6嵌入式版,將其命名為qt-5.9.2-imx6版本,用于在I.MX6平臺(tái)上運(yùn)行程序。
下面就開(kāi)始詳細(xì)介紹搭建、安裝、編譯等全過(guò)程的記錄。
一、準(zhǔn)備工作
1、開(kāi)發(fā)環(huán)境介紹
- 主機(jī)系統(tǒng):win10(64位);
- 虛擬工具:Virtualbox 5.2.0;
- 虛擬系統(tǒng):Ubuntu 14.04(64位);
2、下載QT源碼
直接去官網(wǎng)(http://download.qt.io/archive/qt/)下載QT的源碼即可。
由于某些歷史原因,我這里下載的是5.9.2版本。建議大家也同樣使用這個(gè)版本,畢竟我自己已經(jīng)親自驗(yàn)證過(guò)了。如果您使用新的版本,可能會(huì)遇到一些其他的問(wèn)題。
這里需要注意的是,我們要下載的是源碼壓縮包,而不是現(xiàn)成編譯好的可執(zhí)行文件。所以,請(qǐng)進(jìn)入“single”目錄進(jìn)行下載。我選擇的是后綴名為tar.xz的文件(因?yàn)樗容^小),解壓得分兩步走,先解開(kāi)xz,然后再解開(kāi)tar,命令如下:
3、安裝編譯工具
請(qǐng)確保系統(tǒng)中已安裝gcc、g++和OpenGL。可使用以下命令進(jìn)行測(cè)試并驗(yàn)證它們的具體版本:
I、gcc工具
gcc --version如果沒(méi)有響應(yīng),或者提示gcc沒(méi)有安裝,則可以使用下述命令進(jìn)行安裝:
sudo apt-get install build-essential安裝完成之后,同樣使用上述命令查看一下gcc的版本進(jìn)行確認(rèn)。
II、g++工具
g++ --version如果沒(méi)有響應(yīng),或者提示g++沒(méi)有安裝,則可以使用下述命令進(jìn)行安裝:
sudo apt-get install g++安裝完成之后,同樣使用上述命令查看一下g++的版本進(jìn)行確認(rèn)。
III、OpenGL
glxinfo | grep OpenGL如果提示“程序“glxinfo”尚未安裝”,則可以使用下述命令進(jìn)行安裝:
sudo apt-get install mesa-utils如果提示OpenGL找不到或者沒(méi)有安裝的話,則可使用下述命令安裝(具體的詳細(xì)過(guò)程可參見(jiàn)我的另外一篇博客:如何在Ubuntu 14.04下安裝OpenGL開(kāi)發(fā)環(huán)境)。
sudo apt-get update sudo apt-get install build-essential sudo apt-get install libgl1-mesa-dev sudo apt-get install libglu1-mesa-dev sudo apt-get install libegl1-mesa-dev sudo apt-get install freeglut3-dev安裝完成之后,同樣使用上述命令查看一下OpenGL的版本進(jìn)行確認(rèn)。
4、搭建目錄環(huán)境
根據(jù)QT官方的說(shuō)法,建議大家不要在QT源碼的目錄下直接進(jìn)行編譯,這樣會(huì)污染源碼所在的目錄,無(wú)法達(dá)到多個(gè)版本共存編譯的效果。可以在QT源碼所在的同級(jí)目錄下,新建一個(gè)臨時(shí)用的編譯目錄,只為存放編譯腳本和編譯所產(chǎn)生的臨時(shí)文件。如下:
leon@Ubuntu:~/tempuse$ ll 總用量 20 drwxrwxr-x 4 leon leon 4096 8月 10 11:10 ./ drwxr-xr-x 30 leon leon 4096 8月 10 11:07 ../ drwxrwxr-x 43 leon leon 4096 10月 4 2017 qt-everywhere-opensource-src-5.9.2/leon@Ubuntu:~/tempuse$ mkdir qt-5.9.2-x11 qt-5.9.2-imx6leon@Ubuntu:~/tempuse$ ll 總用量 32 drwxrwxr-x 7 leon leon 4096 8月 10 11:13 ./ drwxr-xr-x 30 leon leon 4096 8月 10 11:07 ../ drwxrwxr-x 2 leon leon 4096 8月 10 11:13 qt-5.9.2-imx6/ drwxrwxr-x 2 leon leon 4096 8月 10 11:13 qt-5.9.2-pc/ drwxrwxr-x 43 leon leon 4096 10月 4 2017 qt-everywhere-opensource-src-5.9.2/于是,可以分別在qt-5.9.2-x11 qt-5.9.2-imx6這2個(gè)目錄下進(jìn)行不同版本的代碼編譯,而不會(huì)影響到源碼所在的目錄。
5、目標(biāo)文件系統(tǒng)
由于最終編譯出來(lái)的程序是要運(yùn)行在I.MX6的嵌入式系統(tǒng)中,因此在編譯的過(guò)程中要引入目標(biāo)文件系統(tǒng)。我這里將該文件系統(tǒng)(fsl-image-gui-imx6qsabresd)解壓放在/opt目錄下。請(qǐng)記住這個(gè)目錄,后面會(huì)用的到。
leon@Ubuntu:~$ cd /opt leon@Ubuntu:/opt$ ll 總用量 32 drwxr-xr-x 8 root root 4096 8月 10 13:39 ./ drwxr-xr-x 23 root root 4096 10月 11 2017 ../ drwxr-xr-x 19 leon leon 4096 11月 14 2017 fsl-image-gui-imx6qsabresd/ drwxr-xr-x 9 root root 4096 10月 11 2017 VBoxGuestAdditions-5.0.20/ drwxr-xr-x 6 root root 4096 6月 9 2017 wps-office_10.1.0.5707~a21_x86_64/二、pc桌面版
1、創(chuàng)建配置腳本
進(jìn)入qt-5.9.2-pc目錄,新建config.sh文件,輸入:
#!/bin/sh./../qt-everywhere-opensource-src-5.9.2/configure \-verbose \-opensource \-release \-shared \-confirm-license \-make libs \-no-feature-cursor \-no-qml-debug \-no-use-gold-linker \-no-iconv \-no-glib \-no-gstreamer \-prefix /opt/qt-5.9.2-pc這里“-prefix /opt/qt-5.9.2-pc“是用于指定編譯之后庫(kù)文件所安裝的位置,你可以按照你自己的規(guī)劃和要求來(lái)更改,但是其他的指令不建議更改。
為config.sh文件增加可運(yùn)行屬性,并運(yùn)行之。大約1-2分鐘之后,結(jié)束,提示配置成功:
Configure summary:Build type: linux-g++ (x86_64, CPU features: mmx sse sse2) Configuration: sse2 sse3 ssse3 sse4_1 sse4_2 avx avx2 compile_examples enable_new_dtags f16c largefile precompile_header shared rpath release c++11 concurrent dbus no-qml-debug reduce_exports reduce_relocations stl Build options:Mode ................................... releaseOptimize release build for size ........ noBuilding shared libraries .............. yesUsing C++ standard ..................... C++11Using ccache ........................... noUsing gold linker ...................... noUsing new DTAGS ........................ yesUsing precompiled headers .............. yesUsing LTCG ............................. noTarget compiler supports:SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2AVX .................................. AVX AVX2 F16CAVX512 ............................... <none>Build parts ............................ libs Qt modules and options:Qt Concurrent .......................... yesQt D-Bus ............................... yesQt D-Bus directly linked to libdbus .... noQt Gui ................................. yesQt Network ............................. yesQt Sql ................................. yesQt Testlib ............................. yesQt Widgets ............................. yesQt Xml ................................. yes Support enabled for:Using pkg-config ....................... yesQML debugging .......................... noudev ................................... noUsing system zlib ...................... yes Qt Core:DoubleConversion ....................... yesUsing system DoubleConversion ........ noGLib ................................... noiconv .................................. noICU .................................... noLogging backends:journald ............................. nosyslog ............................... noslog2 ................................ noUsing system PCRE2 ..................... no Qt Network:getaddrinfo() .......................... yesgetifaddrs() ........................... yesIPv6 ifname ............................ yeslibproxy ............................... noOpenSSL ................................ noQt directly linked to OpenSSL ........ noSCTP ................................... noUse system proxies ..................... yes Qt Gui:Accessibility .......................... yesFreeType ............................... yesUsing system FreeType ................ noHarfBuzz ............................... yesUsing system HarfBuzz ................ noFontconfig ............................. noImage formats:GIF .................................. yesICO .................................. yesJPEG ................................. yesUsing system libjpeg ............... noPNG .................................. yesUsing system libpng ................ noEGL .................................... yesOpenVG ................................. noOpenGL:Desktop OpenGL ....................... yesOpenGL ES 2.0 ........................ noOpenGL ES 3.0 ........................ noOpenGL ES 3.1 ........................ noSession Management ..................... yes Features used by QPA backends:evdev .................................. yeslibinput ............................... noINTEGRITY HID .......................... nomtdev .................................. notslib .................................. noxkbcommon-evdev ........................ no QPA backends:DirectFB ............................... noEGLFS .................................. yesEGLFS details:EGLFS i.Mx6 .......................... noEGLFS i.Mx6 Wayland .................. noEGLFS EGLDevice ...................... noEGLFS GBM ............................ noEGLFS Mali ........................... noEGLFS Raspberry Pi ................... noEGL on X11 ........................... yesLinuxFB ................................ yesVNC .................................... yesMir client ............................. noX11:Using system-provided XCB libraries .. noEGL on X11 ........................... yesXinput2 .............................. noXCB XKB .............................. yesXLib ................................. yesXCB render ........................... yesXCB GLX .............................. yesXCB Xlib ............................. yesUsing system-provided xkbcommon ...... no Qt Widgets:GTK+ ................................... noStyles ................................. Fusion Windows Qt PrintSupport:CUPS ................................... no Qt Sql:DB2 (IBM) .............................. noInterBase .............................. noMySql .................................. noOCI (Oracle) ........................... noODBC ................................... noPostgreSQL ............................. noSQLite2 ................................ noSQLite ................................. yesUsing system provided SQLite ......... noTDS (Sybase) ........................... no Qt SerialBus:Socket CAN ............................. yesSocket CAN FD .......................... yes QtXmlPatterns:XML schema support ..................... yes Qt QML:QML interpreter ........................ yesQML network support .................... yes Qt Quick:Direct3D 12 ............................ noAnimatedImage item ..................... yesCanvas item ............................ yesSupport for Qt Quick Designer .......... yesFlipable item .......................... yesGridView item .......................... yesListView item .......................... yesPath support ........................... yesPathView item .......................... yesPositioner items ....................... yesShaderEffect item ...................... yesSprite item ............................ yes Qt Gamepad:SDL2 ................................... no Qt 3D:Assimp ................................. yesSystem Assimp .......................... noOutput Qt3D Job traces ................. noOutput Qt3D GL traces .................. no Qt 3D GeometryLoaders:Autodesk FBX ........................... no Qt Wayland Client ........................ no Qt Wayland Compositor .................... no Qt Bluetooth:BlueZ .................................. noBlueZ Low Energy ....................... noLinux Crypto API ....................... no Qt Sensors:sensorfw ............................... no Qt Quick Controls 2:Styles ................................. Default Material Universal Qt Quick Templates 2:Hover support .......................... yesMulti-touch support .................... yes Qt Positioning:Gypsy GPS Daemon ....................... noWinRT Geolocation API .................. no Qt Location:Geoservice plugins:OpenStreetMap ........................ yesHERE ................................. yesEsri ................................. yesMapbox ............................... yesMapboxGL ............................. noItemsoverlay ......................... yes Qt Multimedia:ALSA ................................... noGStreamer 1.0 .......................... noGStreamer 0.10 ......................... noVideo for Linux ........................ yesOpenAL ................................. noPulseAudio ............................. noResource Policy (libresourceqt5) ....... noWindows Audio Services ................. noDirectShow ............................. noWindows Media Foundation ............... no Qt WebEngine:Embedded build ......................... noPepper Plugins ......................... yesPrinting and PDF ....................... yesProprietary Codecs ..................... noSpellchecker ........................... yesWebRTC ................................. yesUsing system ninja ..................... noALSA ................................... noPulseAudio ............................. noSystem libraries:re2 .................................. noICU .................................. nolibwebp and libwebpdemux ............. noOpus ................................. noffmpeg ............................... noNote: Also available for Linux: linux-clang linux-iccNote: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing.Qt is now configured for building. Just run 'make'. Once everything is built, you must run 'make install'. Qt will be installed into '/opt/qt-5.9.2-pc'.Prior to reconfiguration, make sure you remove any leftovers from the previous build.說(shuō)明:配置的過(guò)程中,經(jīng)過(guò)我自己的親測(cè),有可能會(huì)提示一些錯(cuò)誤信息,包括下面的make環(huán)節(jié)和install環(huán)節(jié),都有可能會(huì)提示一些錯(cuò)誤信息。但是只要程序不會(huì)自動(dòng)終止,一般就問(wèn)題不大。
2、編譯和安裝
輸入下述命令開(kāi)始編譯。由于源碼內(nèi)容較多,編譯時(shí)間會(huì)很長(zhǎng),以我的電腦i3-4160 3.6GHz處理器+4G內(nèi)存的配置,編譯了差不多60分鐘。
make -j4 -s # -s表示靜默輸出,只提示一些錯(cuò)誤和警告編譯完成后,輸入下述命令便可直接安裝到之前預(yù)設(shè)的目錄下:
sudo make install # sudo是為了提升權(quán)限,如果你的權(quán)限夠可以不用三、imx6嵌入式版
1、修改qmake文件
修改qt源碼目錄下的qtbase/mkspecs/linux-arm-gnueabi-g++目錄下的文件qmake.conf文件為以下內(nèi)容:
# # qmake configuration for building with arm-linux-gnueabi-g++ #MAKEFILE_GENERATOR = UNIX CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublibIMX6_CFLAGS = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 IMX6_CFLAGS_RELEASE = -O2 $$IMX6_CFLAGS QMAKE_CFLAGS_DEBUG += $$IMX6_CFLAGS QMAKE_CXXFLAGS_DEBUG += $$IMX6_CFLAGS QMAKE_CFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASE QMAKE_CXXFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASEinclude(../common/linux.conf) include(../common/gcc-base-unix.conf) include(../common/g++-unix.conf)POKY_PATH = /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi ROOTFS_PATH = /opt/fsl-image-gui-imx6qsabresd# modifications to g++.conf QMAKE_CC = $$POKY_PATH/arm-poky-linux-gnueabi-gcc -mfloat-abi=hard QMAKE_CXX = $$POKY_PATH/arm-poky-linux-gnueabi-g++ -mfloat-abi=hard QMAKE_LINK = $$POKY_PATH/arm-poky-linux-gnueabi-g++ -mfloat-abi=hard QMAKE_LINK_SHLIB = $$POKY_PATH/arm-poky-linux-gnueabi-g++ -mfloat-abi=hard# modifications to linux.conf QMAKE_AR = $$POKY_PATH/arm-poky-linux-gnueabi-ar cqs QMAKE_OBJCOPY = $$POKY_PATH/arm-poky-linux-gnueabi-objcopy QMAKE_NM = $$POKY_PATH/arm-poky-linux-gnueabi-nm -P QMAKE_STRIP = $$POKY_PATH/arm-poky-linux-gnueabi-stripQMAKE_INCDIR += $$ROOTFS_PATH/usr/include QMAKE_LIBDIR += $$ROOTFS_PATH/usr/libQMAKE_LIBS_EGL += -lEGL -lGAL QMAKE_LIBS_OPENGL_ES1 += -lGLESv1_CM -lEGL -lGAL QMAKE_LIBS_OPENGL_ES1CL += -lGLES_CL -lEGL -lGAL QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL -lVSC QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL -lVSCload(qt_config)2、創(chuàng)建配置腳本
進(jìn)入qt-5.9.2-imx6目錄,新建config.sh文件,輸入:
#!/bin/sh./../qt-everywhere-opensource-src-5.9.2/configure \ -verbose \ -opensource \ -release \ -shared \ -confirm-license \ -eglfs \ -linuxfb \ -openvg \ -make libs \ -no-feature-cursor \ -no-qml-debug \ -no-use-gold-linker \ -no-iconv \ -xplatform linux-arm-gnueabi-g++ \ -prefix /opt/qt-5.9.2-imx6 \ -I/opt/fsl-image-gui-imx6qsabresd/usr/include \ -L/opt/fsl-image-gui-imx6qsabresd/usr/lib這里“-prefix /opt/qt-5.9.2-imx6“是用于指定編譯之后庫(kù)文件所安裝的位置,你可以按照你自己的規(guī)劃和要求來(lái)更改,后面兩句話則是用于指定I.MX6文件系統(tǒng)所在的目錄位置,你也可以根據(jù)你自己的情況修改。但是其他的指令不建議更改。
為config.sh文件增加可運(yùn)行屬性,并運(yùn)行之。大約1-2分鐘之后,結(jié)束,提示配置成功:
Configure summary:Building on: linux-g++ (x86_64, CPU features: mmx sse sse2) Building for: linux-arm-gnueabi-g++ (arm, CPU features: neon) Configuration: cross_compile compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 c++14 concurrent dbus no-pkg-config no-qml-debug reduce_exports stl Build options:Mode ................................... releaseOptimize release build for size ........ noBuilding shared libraries .............. yesUsing C++ standard ..................... C++14Using ccache ........................... noUsing gold linker ...................... noUsing new DTAGS ........................ yesUsing precompiled headers .............. yesUsing LTCG ............................. noTarget compiler supports:NEON ................................. yesBuild parts ............................ libs Qt modules and options:Qt Concurrent .......................... yesQt D-Bus ............................... yesQt D-Bus directly linked to libdbus .... noQt Gui ................................. yesQt Network ............................. yesQt Sql ................................. yesQt Testlib ............................. yesQt Widgets ............................. yesQt Xml ................................. yes Support enabled for:Using pkg-config ....................... noQML debugging .......................... noudev ................................... noUsing system zlib ...................... no Qt Core:DoubleConversion ....................... yesUsing system DoubleConversion ........ noGLib ................................... noiconv .................................. noICU .................................... noLogging backends:journald ............................. nosyslog ............................... noslog2 ................................ noUsing system PCRE2 ..................... no Qt Network:getaddrinfo() .......................... yesgetifaddrs() ........................... yesIPv6 ifname ............................ yeslibproxy ............................... noOpenSSL ................................ noQt directly linked to OpenSSL ........ noSCTP ................................... noUse system proxies ..................... yes Qt Gui:Accessibility .......................... yesFreeType ............................... yesUsing system FreeType ................ noHarfBuzz ............................... yesUsing system HarfBuzz ................ noFontconfig ............................. noImage formats:GIF .................................. yesICO .................................. yesJPEG ................................. yesUsing system libjpeg ............... noPNG .................................. yesUsing system libpng ................ noEGL .................................... yesOpenVG ................................. yesOpenGL:Desktop OpenGL ....................... noOpenGL ES 2.0 ........................ yesOpenGL ES 3.0 ........................ yesOpenGL ES 3.1 ........................ noSession Management ..................... yes Features used by QPA backends:evdev .................................. yeslibinput ............................... noINTEGRITY HID .......................... nomtdev .................................. notslib .................................. noxkbcommon-evdev ........................ no QPA backends:DirectFB ............................... noEGLFS .................................. yesEGLFS details:EGLFS i.Mx6 .......................... yesEGLFS i.Mx6 Wayland .................. noEGLFS EGLDevice ...................... noEGLFS GBM ............................ noEGLFS Mali ........................... noEGLFS Raspberry Pi ................... noEGL on X11 ........................... noLinuxFB ................................ yesVNC .................................... yesMir client ............................. no Qt Widgets:GTK+ ................................... noStyles ................................. Fusion Windows Qt PrintSupport:CUPS ................................... no Qt Sql:DB2 (IBM) .............................. noInterBase .............................. noMySql .................................. noOCI (Oracle) ........................... noODBC ................................... noPostgreSQL ............................. noSQLite2 ................................ noSQLite ................................. yesUsing system provided SQLite ......... noTDS (Sybase) ........................... no Qt SerialBus:Socket CAN ............................. yesSocket CAN FD .......................... yes QtXmlPatterns:XML schema support ..................... yes Qt QML:QML interpreter ........................ yesQML network support .................... yes Qt Quick:Direct3D 12 ............................ noAnimatedImage item ..................... yesCanvas item ............................ yesSupport for Qt Quick Designer .......... yesFlipable item .......................... yesGridView item .......................... yesListView item .......................... yesPath support ........................... yesPathView item .......................... yesPositioner items ....................... yesShaderEffect item ...................... yesSprite item ............................ yes Qt Gamepad:SDL2 ................................... no Qt 3D:Assimp ................................. yesSystem Assimp .......................... noOutput Qt3D Job traces ................. noOutput Qt3D GL traces .................. no Qt 3D GeometryLoaders:Autodesk FBX ........................... no Qt Wayland Client ........................ no Qt Wayland Compositor .................... no Qt Bluetooth:BlueZ .................................. noBlueZ Low Energy ....................... noLinux Crypto API ....................... no Qt Sensors:sensorfw ............................... no Qt Quick Controls 2:Styles ................................. Default Material Universal Qt Quick Templates 2:Hover support .......................... yesMulti-touch support .................... yes Qt Positioning:Gypsy GPS Daemon ....................... noWinRT Geolocation API .................. no Qt Location:Geoservice plugins:OpenStreetMap ........................ yesHERE ................................. yesEsri ................................. yesMapbox ............................... yesMapboxGL ............................. yesItemsoverlay ......................... yes Qt Multimedia:ALSA ................................... noGStreamer 1.0 .......................... noGStreamer 0.10 ......................... noVideo for Linux ........................ yesOpenAL ................................. noPulseAudio ............................. noResource Policy (libresourceqt5) ....... noWindows Audio Services ................. noDirectShow ............................. noWindows Media Foundation ............... no Qt WebEngine:Embedded build ......................... yesPepper Plugins ......................... noPrinting and PDF ....................... noProprietary Codecs ..................... noSpellchecker ........................... yesWebRTC ................................. noUsing system ninja ..................... noALSA ................................... noPulseAudio ............................. noSystem libraries:re2 .................................. noICU .................................. nolibwebp and libwebpdemux ............. noOpus ................................. noffmpeg ............................... noNote: Also available for Linux: linux-clang linux-iccNote: No wayland-egl support detected. Cross-toolkit compatibility disabled.WARNING: Cross compiling without sysroot. Disabling pkg-configQt is now configured for building. Just run 'make'. Once everything is built, you must run 'make install'. Qt will be installed into '/opt/qt-5.9.2-imx6'.Prior to reconfiguration, make sure you remove any leftovers from the previous build.說(shuō)明:配置的過(guò)程中,經(jīng)過(guò)我自己的親測(cè),有可能會(huì)提示一些錯(cuò)誤信息,包括下面的make環(huán)節(jié)和install環(huán)節(jié),都有可能會(huì)提示一些錯(cuò)誤信息。但是只要程序不會(huì)自動(dòng)終止,一般就問(wèn)題不大。
3、編譯和安裝
輸入下述命令開(kāi)始編譯。由于源碼內(nèi)容較多,編譯時(shí)間會(huì)很長(zhǎng),以我的電腦i3-4160 3.6GHz處理器+4G內(nèi)存的配置,編譯了差不多90分鐘。
make -j4 -s # -s表示靜默輸出映射,只提示一些警告和錯(cuò)誤編譯完成后,輸入下述命令便可直接安裝到之前預(yù)設(shè)的目錄下:
sudo make install # sudo是為了提升權(quán)限,如果你的權(quán)限夠可以不用四、寫(xiě)在后面
至此,桌面版和嵌入式版共2個(gè)版本的QT庫(kù)全部編譯和安裝完成,分別位于opt目錄下的指定位置。接下去就是安裝QTCreator,然后在其中配置好相關(guān)的套件環(huán)境即可,在此不做記錄。有需要的同學(xué)可參見(jiàn)我的其他博客中的記錄。
leon@Ubuntu:~$ cd /opt leon@Ubuntu:/opt$ ll 總用量 40 drwxr-xr-x 10 root root 4096 8月 10 16:20 ./ drwxr-xr-x 23 root root 4096 10月 11 2017 ../ drwxr-xr-x 19 leon leon 4096 11月 14 2017 fsl-image-gui-imx6qsabresd/ drwxr-xr-x 10 root root 4096 8月 10 14:42 qt-5.9.2-imx6/ drwxr-xr-x 10 root root 4096 8月 10 13:40 qt-5.9.2-pc/ drwxr-xr-x 9 root root 4096 10月 11 2017 VBoxGuestAdditions-5.0.20/ drwxr-xr-x 6 root root 4096 6月 9 2017 wps-office_10.1.0.5707~a21_x86_64/ 創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的Ubuntu 14.04系统下安装和编译QT 5.9.2库(桌面版/ARM嵌入式IMX6版)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: AMD 未曾忘记 Radeon RX 6
- 下一篇: 填补国内空白,我国首台抛雪机亮相京新高速