Qt5.7.0 compiled and ported to Linux-Arm-A9

Compile Qt5.7.0 in Linux environment

       My system is Ubuntu 16.04 and the compiler is arm-linux-gnueabihf-gcc5.4, which can be installed directly in ubuntu16.04.

Compile:

first step:

Download qt-everywhere-opensource-src-5.7.0.tar.gz, this Qt official has. Install arm-linux-gnueabihf-gcc:

$ sudo apt install gcc-arm-linux-gnueabi
$ sudo apt install gcc-arm-linux-gnueabihf

Step 2:

Find an English directory and put qt-everywhere-opensource-src-5.7.0.tar.gz into it. Unzip with terminal:

$: tar -zxvf qt-everywhere-opensource-src-5.7.0.tar.gz

It is best not to right-click "Extract here", this decompression seems to be different from the command decompression, and it will be pitted when compiling.

third step:

Modify the compilation configuration file, in the directory: qt-everywhere-opensource-src-5.7.0/qtbase/mkspecs/linux-arm-gnueabi-g++/ below qmake.conf. (note my change) to:

#
# qmake configuration for building with arm-linux-gnueabi-g++
#

MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

# modifications to g++.conf
QMAKE_CC                = arm-linux-gnueabihf-gcc
QMAKE_CXX               = arm-linux-gnueabihf-g++
QMAKE_LINK              = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = arm-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = arm-linux-gnueabihf-objcopy
QMAKE_NM                = arm-linux-gnueabihf-nm -P
QMAKE_STRIP             = arm-linux-gnueabihf-strip
load(qt_config)

the fourth step:

Before compiling, there is one more change, eh. . . qt3d and qtcanvas3d will report an error when compiling, saying that the module is not recognized, and there is no opengl embedded in it, and an error will be reported when it is recognized, resulting in a compilation failure, and there is no configuration for these two modules in the compilation configuration parameters. My solution is simple and rude. Add -no-opengl to the parameter during configuration, then open the qt-everywhere-opensource-src-5.7.0/qt.pro file and find:

addModule(qt3d, qtdeclarative qtimageformats)
addModule(qtcanvas3d, qtdeclarative)

Comment out these two lines (# comment), or delete them directly. If it is not commented out, even if -no-opengl is added, an error will be reported and the compilation will fail.

the fifth step:

Configure the compilation parameters, use ./configre -help to view the parameters. My configuration is:

$./configure -release -opensource -xplatform linux-arm-gnueabihr-g++ -prefix /opt/Qt-5.5.7/armv7-a -c++11 -no-opengl

Note: The red part is the location where your Qt library will be installed, be careful, if you want to install it later, write that. The location was moved, and qmake could not find the library when using it. Although it can be configured, it is very troublesome to configure the path when each project is used. -no-opengl means no opengl. I didn't add the parameter -qreal float because I found that it couldn't be edited after adding it. An error will be reported when compiling to.../qtbase/src/gui/painting/qpdf.cpp.

Step 6:

If there is no problem with the above configuration, then make:

$make

or

$make -j2      /*CPU 几个核可以使用“-j几”,核多编的快*/

Wait 20~120 minutes. . . Finish.

Step 7:

Install:

$sudo make install

Adding sudo here is because the library files will be copied to the installation directory (/opt/Qt-5.7.0/armv7-a) configured in step 7 above during installation, and the opt directory requires root privileges.

Step 8: Step 9: Step 10:

       Compile the platform plug-in. After Qt5, the embedded QWS (Qt windows system-Qt form system) was deleted and replaced by QPA (Qt Platform Abstration-Qt platform abstraction). The platform plug-in is in qt-everywhere-opensource-src-5.7. 0/qtbase/src/plugins/platforms/ below. There are plug-ins for various platforms. The frambuffer-based plug-ins are under the lunuxfb folder. Others include android, ios, winrt, windows, etc., whichever platform needs to be compiled. Parameters should be added when QPA is running.

       Well, this is the process of compiling Qt5.7.0. This I cut off qt3d and qtcanvas3d.

{{o.name}}
{{m.name}}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324041729&siteId=291194637