树莓派Qt5.14.2源码编译

1 篇文章 0 订阅
1 篇文章 0 订阅

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>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值