1.1源码下载
wget https://download.qt.io/archive/qt/5.14/5.14.2/single/qt-everywhere-src-5.14.2.zip
#解压
unzip qt-everywhere-src-5.14.2.zip
1.2配置
先下载树莓派的配置文件
直接访问 https://github.com/oniongarlic/qt-raspberrypi-configuration 打包下载解压后
把里面的 linux-rpi4-v3d-g++ 文件夹放到 qt-everywhere-src-5.13.2/qtbase/mkspecs 目录里
按照这样编译不了的,报错: 不支持参数 -mfpu=crypto-neon-fp-armv8
到 linux-rpi4-v3d-g++ 目录里,打开 qmake.conf 修改
QMAKE_CFLAGS += -march=armv8-a -mtune=cortex-a72
#编译配置参数
./configure -platform linux-rpi4-v3d-g++ -v \
-opengl es2 \
-opensource \
-confirm-license \
-release \
-reduce-exports \
-ssl \
-qt-xcb \
-tslib \
-no-compile-examples \
-skip wayland \
-skip qtquickcontrols \
-skip qtquickcontrols2 \
-skip qtsensors \
-skip qtdoc \
-skip qtquick3d \
-skip qtquicktimeline \
-skip qttools \
-skip qtwayland \
-skip qtwebengine \
-system-freetype \
-fontconfig \
-glib \
-prefix /home/toor/opt/Qt5.14.2 \
-recheck-all
其中
EGLFS details:
EGLFS OpenWFD ........................ no
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS RCAR ........................... no
EGLFS EGLDevice ...................... yes
EGLFS GBM ............................ yes
EGLFS VSP2 ........................... no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGLFS X11 ............................ yes
EGLFS Raspberry Pi 选项必须为no,若为yes,则修改树莓派下
sudo mv /usr/include/bcm_host.h /usr/include/bcm_host.h.bak
待编译结束后恢复文件
sudo mv /usr/include/bcm_host.h.bak /usr/include/bcm_host.h
2.编译问题
platform/default/bidi.cpp: In member function ‘void mbgl::BiDi::mergeParagraphLineBreaks(std::set<long unsigned int>&)’:
platform/default/bidi.cpp:63:24: error: ‘runtime_error’ is not a member of ‘std’
63 | throw std::runtime_error(std::string("ProcessedBiDiText::mergeParagraphLineBreaks: ") +
| ^~~~~~~~~~~~~
platform/default/bidi.cpp: In member function ‘std::vector<std::__cxx11::basic_string<char16_t> > mbgl::BiDi::processText(const u16string&, std::set<long unsigned int>)’:
platform/default/bidi.cpp:98:20: error: ‘runtime_error’ is not a member of ‘std’
98 | throw std::runtime_error(std::string("BiDi::processText: ") + u_errorName(errorCode));
| ^~~~~~~~~~~~~
platform/default/bidi.cpp: In member function ‘std::u16string mbgl::BiDi::getLine(std::size_t, std::size_t)’:
platform/default/bidi.cpp:109:20: error: ‘runtime_error’ is not a member of ‘std’
109 | throw std::runtime_error(std::string("BiDi::getLine (setLine): ") + u_errorName(errorCode));
| ^~~~~~~~~~~~~
platform/default/bidi.cpp:125:20: error: ‘runtime_error’ is not a member of ‘std’
125 | throw std::runtime_error(std::string("BiDi::getLine (writeReordered): ") +
修改Qt源码,分别修改qt源码路径下
1.3rdparty/mapbox-gl-native/platform/default/bidi.cpp
+#include <stdexcept>
#include <mbgl/text/bidi.hpp>
#include <mbgl/util/traits.hpp>
2./3rdparty/mapbox-gl-native/include/mbgl/util/util.hpp
#else
#define MBGL_CONSTEXPR inline
#endif
+
+#include <cstdint>