Qt5.5.0 compilation ported to LINUX-ARM-A9

Source: Internet
Author: User

This is my second blog, hehe. The last time I was complaining was the first time I wrote a blog. I chose to write a blog in the open source Chinese community because it has a lot of information about the technology and programmers (news), and there are a lot of technical information and open source software readily available, download is also convenient. The most important thing is that I like to see the above comments, whether it is sprayed or sprayed jet, are very meaning. The amount ... I'm not advertising, I'm just expressing my feelings.

QT4 to 5 There are many changes, first the meta-object system has changed, the QT5 signals and slots are based on the template instead of the previous string. In this way, the signal and groove performance should be improved a lot. In fact, the signal and the slot is not slow, just a lot of QT on the reverse side of the old people take this to say things. QT5 signal Connection slot can not use slot declaration, but here I have a problem, QT signal and slot is not the default value of function parameters, there is a default value I found that no matter the use, is the slot does not respond to the signal, if the QT5 signal can be bound to any slot, do not know the signal and slot parameters default value of the signal line. Qt5 's qtcreator is better than the previous, easy to debug. Other aspects have a lot of improvements, Qt5.5.0 added Qt3d and qtcanvas3d modules, but the embedded can not be used, you need to have embedded platform OpenGL. Well, that's all I can say, let's see Qt5.5.0 compile porting.

My system is Ubuntu 14.04 compiler is ARM-NONE-LINUX-GNUEABI-GCC 4.8.3. here , because a lot of people (including our company) use the friendly arm of the Friendlyarm compiler, but the version is too old, ARM-LINUX-GCC has a bug, compile time only know how to pit, Here I give a 4.8.3 connection:http://www.veryarm.com/arm-none-linux-gnueabi-gcc go in to download the latest, or the network disk http://pan.baidu.com/s/1nt46q2t

Compile:

The first step: Download qt-everywhere-opensource-src-5.5.0.tar.gz, this QT official has. Download ARM-NONE-LINUX-GNUEABI-GCC. Note the connection I gave to this. If you look for resources, do not download Gcc-arm-none-eabi, this is for bare-metal embedded compiler.

The second step: decompression ARM-NONE-LINUX-GNUEABI-GCC, decompression finished (folder name is arm-2014.05, I changed to arm), directly copied/opt/below:

$ sudo cp arm/opt/

Step Three: Configure the environment variables, under Ubuntu14.04, switch to the home directory:

$ cd ~

$ VI. BASHRC

Add $path:/opt/arm/bin/after path, or add a row if there is no path:

Export path= $PATH:/opt/arm/bin/

Then save the exit. Let the environment variable take effect. If you do not log off, then login will take effect.

Fourth step: Find an English catalogue and put qt-everywhere-opensource-src-5.5.0.tar.gz in. Unzip with terminal:

$: TAR-ZXVF qt-everywhere-opensource-src-5.5.0.tar.gz

Do not right-click Extract here, this decompression seems to be different from the command decompression, anyway right-click Extract, to compile the time you will know how the pit. I compiled it for two days and nights, and a couple of times it was the result.

Fifth Step: Modify the Compilation configuration file, in the directory: qt-everywhere-opensource-src-5.5.0/qtbase/mkspecs/linux-arm-gnueabi-g++/below qmake.conf. (Red is my change) instead:

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

Makefile_generator = UNIX
CONFIG + = Incremental
Qmake_incremental_style = Sublib

qt_qpa_default_platform = Linux #eglfs
Qmake_cflags_release + =-o2-march=armv7-a
Qmake_cxxflags_release + =-o2-march=armv7-a

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

# Modifications to G++.conf
QMAKE_CC = Arm-none-linux-gnueabi-gcc
Qmake_cxx = Arm-none-linux-gnueabi-g++
Qmake_link = Arm-none-linux-gnueabi-g++
Qmake_link_shlib = Arm-none-linux-gnueabi-g++

# Modifications to Linux.conf
Qmake_ar = Arm-none-linux-gnueabi-ar CQS
Qmake_objcopy = Arm-none-linux-gnueabi-objcopy
QMAKE_NM = Arm-none-linux-gnueabi-nm-p
Qmake_strip = Arm-none-linux-gnueabi-strip
Load (qt_config)

Sixth step: Before compiling, there is a change, the amount ... Qt3d and Qtcanvas3d in the compile time will be error, said is not recognized module, and embedded without OpenGL, recognized also will error, resulting in compilation failure, and the compiler configuration parameters there is no configuration of these two modules. My workaround is simple and rude, add-NO-OPENGL when configuring the parameter, and then open the qt-everywhere-opensource-src-5.5.0/qt.pro file to find:

Addmodule (Qt3d, qtdeclarative qtimageformats)
Addmodule (Qtcanvas3d, qtdeclarative)

These two lines are commented out (#号注释) or deleted directly. If not commented out, even if the addition of-NO-OPENGL will error, the compilation failed.

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

$./configure-release-opensource-xplatform linux-arm-gnueabi-g++-prefix /opt/qt-5.5.0/armv7-a -no-c++11- No-opengl

Note: The red part is where your QT library will be installed, be careful, if you want to install it later, write that. Moved the position, when using the qmake can not find the library. Although can be configured, but each project with the time to have a path, very troublesome. The-no-c++11 in the parameter, which means no c++11, does not add this parameter, may compile however,-no-opengl indicates that there is no OpenGL. I did not add the parameter-qreal float, because I found, plus after the compilation. Error when compiling to .../qtbase/src/gui/painting/qpdf.cpp.

Eighth step: If the above configuration is not a problem, then make:

$make

Wait two hours ...

Nineth Step: Install:

$sudo make Install

Add sudo here because, the installation will copy the library files to the installation directory of the seventh step configuration above (red /opt/qt-5.5.0/armv7-a ), the OPT directory requires root permissions.

Tenth step: Compile the Platform plugin, since QT5, deleted the embedded QWS (qt Windows system-qt form System) replaced QPA (QT Platform abstration-qt platform abstraction), The platform plugin is below qt-everywhere-opensource-src-5.5.0/qtbase/src/plugins/platforms/. There are various platform plug-ins, based on the Frambuffer plug-in is LUNUXFB this folder, and other Android, iOS, WINRT, Windows, and so on, what needs to compile the platform. Qpa run time to add parameters, I have not tried, still do not know, online someone use can refer to.

Well, this is the process of compiling Qt5.5.0. I cut Qt3d and qtcanvas3d off. Someone has to ask, the new features are gone, it is better to use the old. The amount ... If it's Qt4, it's better to transplant it. Because this change is not generally big, it is necessary. Qt5 's words may not change much, but Qt5.5.0 is said to have fixed 1500 bugs. I have not compiled Qt5.5.0 previous version, has been waiting, etc is 5.5.0, after all, this is a large version.

Qt5.5.0 compilation ported to LINUX-ARM-A9

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.