从源代码构建 Qt5:将不会构建 QtWebEngineCore 模块。构建 QtWebEngine 需要工具 gperf

问题描述 投票:0回答:1

我在标题中提供了所有信息。 我已经交叉编译了 Qt5.15.3,并尝试用它构建 CQtDeployer,而 CQtDeployer 需要 qtwebengine。

最初我不需要 qtwebengine,但正如我所说,我现在需要它来构建 cqtdeployer 我已经安装了此处指定的 QtWebEngine 所需的所有内容:https://wiki.qt.io/Building_Qt_5_from_Git 并执行了以下操作:

cd qt-everywhere-src-5.15.3/qtwebengine
../qtbase/bin/qmake -r .
make

但是构建 QtWebEngineCore 和 QtPdf 失败,尽管安装了

gperf
,但出现以下消息:

make[2]: Entering directory '/xch/qt-everywhere-src-5.15.3/qtwebengine/src/core'
QtWebEngineCore module will not be built. Tool gperf is required to build QtWebEngine.
make[2]: Leaving directory '/xch/qt-everywhere-src-5.15.3/qtwebengine/src/core'
cd pdf/ && ( test -e Makefile || /xch/qt-everywhere-src-5.15.3/qtbase/bin/qmake -o Makefile /xch/qt-everywhere-src-5.15.3/qtwebengine/src/pdf/pdf.pro ) && make -f Makefile 
make[2]: Entering directory '/xch/qt-everywhere-src-5.15.3/qtwebengine/src/pdf'
QtPdf will not be built. Tool gperf is required to build QtPdf.
make[2]: Leaving directory '/xch/qt-everywhere-src-5.15.3/qtwebengine/src/pdf'
make[1]: Leaving directory '/xch/qt-everywhere-src-5.15.3/qtwebengine/src'

编辑:

gperf --版本

GNU gperf 3.0.4
Copyright (C) 1989-1998, 2000-2004, 2006-2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Douglas C. Schmidt and Bruno Haible.
/bin/sh: 1: parse_git_branch: not found
qt qt5 cross-compiling
1个回答
0
投票

我已经在 Debian12 上使用 QtWebEngine 从源代码构建了 Qt 库。对我来说最困难的部分是安装构建 Qt+QtWebEngine 所需的所有基本依赖项。 这是在 Debian 上安装 Qt 依赖项的脚本: #################################################### ###########

#!/usr/bin/bash apt update && apt install cmake ninja-build build-essential libgl1-mesa-dev libfontconfig1-dev libfreetype-dev libx11-dev libx11-xcb-dev libxcb-cursor-dev -y




 apt install libxcb-glx0-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-sync-dev libxcb-util-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb1-dev libxext-dev libxfixes-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libxrender-dev libatspi2.0-dev bison build-essential gperf flex  libasound2-dev libcups2-dev libdrm-dev libegl1-mesa-dev libnss3-dev libpci-dev libpulse-dev libudev-dev nodejs libxtst-dev gyp libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libfontconfig1-dev libxss-dev libwebp-dev libjsoncpp-dev libopus-dev libminizip-dev libavutil-dev libavformat-dev libavcodec-dev libevent-dev libvpx-dev libsnappy-dev libre2-dev libprotobuf-dev protobuf-compiler libxshmfence-dev libxshmfence1 libmd4c-html0 libxkbfile-dev linux-libc-dev linux-headers-$(uname -r) -y
         
    #apt install clang-15 libclang-15-dev clang-tools-15
        
    apt install python3-html5lib libice-dev libxcb-util0-dev libxext-doc libxcb-composite0-dev libxcb-damage0-dev libx11-doc libx11-freedesktop-desktopentry-perl libx11-guitest-perl libx11-keyboard-perl libx11-protocol-other-perl libx11-windowhierarchy-perl libx11-xcb-perl libsm-dev libsm-doc libsmali-java libsmart-comments-perl libsmartcols-dev libsmbclient-dev libsmbios-dev libsmbios-doc libsmc-dev libsmdev-dev libsmf-dev libsmi2-common libsmi2-dev libsmiles-scripts-java libsmiles-scripts-perl libsmithwaterman-dev libsml-dev libsmlnj-smlnj libsmltk0 libsmpeg-dev libsmpp34-1 libsmpp34-dev libsmraw-dev libsmraw-utils libsms-aql-perl libsms-send-aql-perl python3-libsmbios python3-libsmdev python3-libsmraw libice-doc libicecc-dev libiceoryx-binding-c-dev libiceoryx-introspection-dev low-memory-monitor libpthreadpool-dev libmd4c-dev libmd4c-html0-dev libxcb-doc libxcb-dpms0-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-present-dev libxcb-record0-dev libxcb-res0-dev libxcb-screensaver0-dev libxcb-xf86dri0 libxcb-xf86dri0-dev libxcb-xinput-dev libxcb-xtest0 libxcb-xtest0-dev libxcb-xv0-dev libxcb-xvmc0 libxcb-xvmc0-dev xcb-proto debhelper xutils-dev xsltproc check dctrl-tools doxygen libxcb-errors-dev libxcb-ewmh-dev libxcb-imdkit-dev libxcb-xrm-dev libxkbcommon-doc libxkbcommon-tools libfontconfig-doc libfreetype6-dev -y

   
echo "deb http://archive.debian.org/debian/ stretch contrib main non-free" >> /etc/apt/sources.list && apt-get update
apt install python2.7 -y
if test -f /usr/bin/python; then  rm /usr/bin/python; fi
ln -s /bin/python2.7 /usr/bin/python

################################################## ############ 之后,我取消存档 qt-exerywhere-opensourcesrc-6.2.x.tar.xz 存档:

tar xf qt-everywhere-opensource-src-6.2.9.tar.xz

然后创建./build和./Qt6.2.x目录:

mkdir Qt6.2.x mkdir build && cd ./build And configured cmake:

    ../qt-everywhere-src-6.2.9/configure -shared -release -c++std c++20

cmake 在构建目录中配置了 Ninja 项目。 然后我开始建造:

cmake --build . --parallel 4

我大约需要7个小时。

然后将构建的Qt库安装到../Qt6.2.x目录:

cmake --install . --prefix ../Qt6.2.9

P.S.:要构建 Qt6.2.4,需要 3.24.0 或更低版本的 cmake。

© www.soinside.com 2019 - 2024. All rights reserved.