In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the raspberry pie how to achieve Qt5 cross-compilation transplantation, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Raspberry Pi (BCM2835): Device InformationArchitectureARMv6CPUARM11RAM256MB OR 512MB since October 2012 (shared with GPU) GPUVideoCore IVOpenGLOpenGL ES 2.0MultimediaOpenMax IL 1.1.2Qt 5.0 (eglfs/QPA) Supported, with OpenGL ES 2.0Qt 5 port functional state (against Raspbian Wheezy (primary reference platform)) FeatureStateAdditional infoHardware accelerated cursorDoneupstreamWayland supportDoneupstreamHardware decoding of imagesTo Do
Scenegraph tailoringTo Do
HardFP supportDoneRequires v8 patchQt MultimediaDoneRequires gst-omxWebkit integrationTo Dowebgl, tex mapper start
First, let's create a directory to store the Qt5 source code and all the files needed for cross-compilation. I chose to create a directory called "opt" in the current user's home directory.
1diveinedu@debian: ~ $mkdir ~ / opt2diveinedu@debian: ~ $cd ~ / opt
Then, download the following files:
Download the Raspbian Wheezy image (download [raspberrypi.org] here):
1diveinedu@debian: ~ / opt$ wget http://downloads.raspberrypi.org/images/raspbian/2013-02-09-wheezy-raspbian/2013-02-09-wheezy-raspbian.zip2diveinedu@debian: ~ / opt$unzip 2013-02-09-wheezy-raspbian.zip
After downloading and decompressing, mount the image:
1diveinedu@debian: ~ / opt$ sudo mkdir / mnt/rasp-pi-rootfs2diveinedu@debian:~/opt$ sudo mount-o loop,offset=62914560 2013-03-09-wheezy-raspbian.img / mnt/rasp-pi-rootfs
Instead of introducing cross-tool chain compilation, we can download the cross-compilation tool chain customized for raspberry pie optimization (or use the raspberry pie tool chain https://github.com/raspberrypi/tools) on github:
1diveineduplex debiandised robot opt$ wget http://blueocean.qmh-project.org/gcc-4.7-linaro-rpi-gnueabihf.tbz2diveinedu@debian:~/opt$ tar-xf gcc-4.7-linaro-rpi-gnueabihf.tbz
Because the above cross-compilation tool is 32-bit Linux, if you are using 64-bit Linux, you also need to install the 32-bit runtime package:
1diveineduplex debiandised robot opt$ sudo apt-get install ia32-libs
If you are using a Debian Wheezy 64-bit system, the above will not work because multiarch-support is enabled on Debian Wheezy 64-bit and you need to execute:
1 add-architecture i3863 diveineduplex debiandise robot opt$ sudo apt-get update4diveinedu@debian:~/opt$ sudo apt-get install ia32-libs
Clone a cross-compile-tools from the remote repository to local:
1diveineduplex debiandised robot opt$ git clone git://gitorious.org/cross-compile-tools/cross-compile-tools.git
Clone a copy of the source code of Qt5 from the remote repository to local:
1 diveineduplex debiandised robot opt$ git clone git://gitorious.org/qt/qt5.git2diveinedu@debian:~/opt$ cd qt53diveinedu@debian:~/opt/qt5 $. / init-repository
Finally, patch the qtjsback subproject to support the raspberry pie of the armv6 instruction set:
1diveinedu@debian:~/opt/qt5 $cd ~ / opt/qt5/qtjsbackend2diveinedu@debian:~/opt/qt5 $git fetch https://codereview.qt-project.org/p/qt/qtjsbackend refs/changes/56/27256/4 & & git cherry-pick FETCH_HEAD
The code to resolve the conflict if there is a conflict.
Compile qtbase
Now that we have all the resources needed to cross-compile Qt5 for raspberry pie, all we need to do is execute a small script to modify the symbolic link and library file path settings:
1diveinedu@debian:~/opt/qt5 $cd ~ / opt/cross-compile-tools2diveinedu@debian:~/opt/qt5 $sudo. / fixQualifiedLibraryPaths / mnt/rasp-pi-rootfs/ ~ / opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-gcc
Go to the qt5/qtbase directory and execute the following script to configure and compile:
1diveinedu@debian:~/opt/qt5 $cd ~ / opt/qt5/qtbase2diveinedu@debian:~/opt/qt5/qtbase$. / configure-opengl es2-device linux-rasp-pi-g++-device-option CROSS_COMPILE=~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf--sysroot / mnt/rasp-pi-rootfs-opensource-confirm-license-optimized-qmake-reduce-relocations-reduce-exports-release-make libs-prefix / usr/local/qt5pi-no-pch3diveinedu@debian : ~ / opt/qt5/qtbase$ make-j 44diveineduplex debiansaw compilation of other modules using optmax qt5max qtbase$ sudo make install
By this time, you already have the qmake tool for cross-compilation of raspberry pie. You can cross-compile other modules of Qt5 one by one. In order to avoid dependency errors that may occur in the module compilation process, it is recommended to compile in this module order: qtimageformats, qtsvg, qtjsbackend, qtscript, qtxmlpatterns, qtdeclarative, qtsensors, qt3d, qtgraphicaleffects,qtjsondb,qtlocation, qtdocgallery.
Similar commands related to module compilation:
1diveinedu@debian:~/opt/qt5 $cd qtimageformats2diveinedu@debian:~/opt/qt5/qtimageformats$ / usr/local/qt5pi/bin/qmake .3diveinedu @ debian:~/opt/qt5/qtimageformats$ make-j44diveineduplex debianizationCompact optUnique qt5 qtimageformats $sudo make install
After you execute the compile and install commands in sequence for all the modules you need or want to compile, everything you need is installed in the raspbain wheezy image. Our next step is to burn him on the SD card. SD card burning command:
1diveinedu@debian:~/opt/qt5 $cd ~ / opt/2diveinedu@debian:~/opt$ sync; sudo umount / mnt/rasp-pi-rootfs3diveinedu@debian:~/opt$ sudo dd bs=1M if=2013-02-09-wheezy-raspbian.img of=/dev/sdc; sync
Tip: / dev/sdc is the SD device I use, please modify it according to your actual situation.
Thank you for reading this article carefully. I hope the article "how to realize Qt5 cross-compilation and migration of raspberry pie" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.