Build qt5.15.0 qtwebengine on SUSE SLE-15

2024-04-17 10:32

本文主要是介绍Build qt5.15.0 qtwebengine on SUSE SLE-15,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1. 目的。

qt4升级qt5之后,QString::toDouble方法不依赖于locale,导致很多欧洲国家(e.g.Germany,使用,作为小数点)转换有问题。 因此修改qt库,在QString::toDouble中直接调用QLocale的toDouble方法。仅仅编译qtbase (libQt5Core.so.5.15.0 不行,提示Qt5WebEngineCore), 以此也需要编译qtwebengine。

2. 准备环境。

2.1 查看README

因为Src/qtwebengine下没有README文件,所以,查看Src下的README文件,给出:

System requirements
------------------
- Perl 5.8 or later //当前版本为v5.26.1
- Python 2.7 or later // 当前版本为v2.7.17
- C++ compiler supporting the C++11 standard // 当前支持
For other platform specific requirements,
please see section “Setting up your machine” on:
http://wiki.qt.io/Get_The_Source

根据 README提示,进入https://doc.qt.io/qt-5/linux-requirements.html, 按照文档要求,检查以下依赖库是否全部安装(包含但不限于):

libxcb 1.11 libXrender libxcb-render libxcb-render-util libxcb-shape libxcb-randr libxcb-xfixes libxcb-sync libxcb-shm libxcb-icccm libxcb-keysyms libxcb-image libxkbcommon libxkbcommon-x11 libfontconfig libfreetype libXext libX11 libxcb libX11-xcb libSM libICE libglib-2.0 libpthread
libatspi opengl flite1-dev libspeechd-dev speech-dispatcher

关于 Qt WebEngine Dependencies https://doc.qt.io/qt-5/qtwebengine-platform-notes.html.

On all platforms, the following tools are required at build time:
Python 2.7.5 or later. Python 3 is not supported.
Bison, Flex
GPerf
Node.js for a full featured Dev Tools.

On Linux, Clang or GCC version 5 or later is required. Supported configurations are linux-g++, linux-clang and linux-clang-libc++

Qt WebEngine requires pkg-config to detect most of its dependencies. The following pkg-config files are required:

dbus-1
fontconfig
If Qt was configured for xcb, the following pkg-config files are also required:

libdrm
xcomposite
xcursor
xi
xrandr
xscrnsaver
xtst
Further, development packages for khr and libcap need to be installed.

2.2 查看chromium/doc/README.md

参考官方文档:
Checking out and building Chromium on Linux
https://chromium.googlesource.com/chromium/src/+/0e94f26e8/docs/linux_build_instructions.md
https://chromium.googlesource.com/chromium/src/+/0e94f26e8/docs/linux_open_suse_build_instructions.md
要求 64-bit 最低8GB内存最好16G以上(当前板子配置为 Intel 64-bit 4核 8G 内存, 配置较低,编译耗时较长,ninja编译过程中容易死机):

System requirements
64-bits: x86 builds are not supported on Linux.
Memory: >16GB is highly recommended.
Disk space: Expect a full checkout and build to take nearly 100GB.
Distribution: You should be able to build Chromium on any reasonably modern Linux distribution, but there are a lot of distributions and we sometimes break things on one or another. Internally, our development platform has been a variant of Ubuntu 14.04 (Trusty Tahr); we expect you will have the most luck on this platform.

chrome 官方给出的是Ubuntu的依赖库配置,其他发行版没有给出官方配置。在这里插入图片描述
根据文档,yast安装以下依赖,有的已经装了,用yast检查一下:
pkg-config python perl bison flex gperf, mozilla-nss-devel glib2-devel gtk-devel wdiff lighttpd gcc gcc-c++ , mozilla-nspr mozilla-nspr-devel php5-fastcgi alsa-devel libexpat-devel , libjpeg-devel libbz2-devel

Note:
  • wdiff 安装时提示依赖库,可以跳过去不依赖。
  • gtk-deve 不确定装哪个,全部装了.
  • php5-fastcgi找不到,装的是php7-fastcgi。

根据wiki,https://wiki.qt.io/Qt_5.15_Tools_and_Versions 针对SLES15 x86_64:

  • OpenSSL 版本必须是1.1.1d,当前版本是1.1.0i, 需更新版本,为了不影响系统对1.1.0i的依赖,最好安装在指定目录,用的时候指定就可以。具体操作见博客
    openssl库的编译安装-SUSE 15
  • libclang 要求版本6.0, 当前为低版本,需从https://software.opensuse.org/explore上下载安装包。 由于不能relocate/prefix指定安装路径,只能装在默认路径下。

在这里插入图片描述

Software configurations for Qt 5.15.0

3. qmake生成makefile文件

由于qtwebengine 下没有configure 文件,执行 qmake qtwebengine.pro生成makefile.
或者在Src(上级目录)下 执行configure:
./configure --prefix=/optQt5.15.0/5.15.0/gcc_64 -I/home/ms1/workspace/tools/openssl/install-bak/include -L/home/ms1/workspace/tools/openssl/install-bak/lib -nomake examples -nomake tests -recheck-all

查看config.summary:

  Use System Ninja ....................... yesUse System Gn .......................... noJumbo Build Merge Limit ................ 8Developer build ........................ noQtWebEngine required system libraries:fontconfig ........................... yesdbus ................................. yesnss .................................. yeskhr .................................. yesglibc ................................ yesOptional system libraries used:re2 .................................. yesicu .................................. nolibwebp, libwebpmux and libwebpdemux . yesopus ................................. yesffmpeg ............................... nolibvpx ............................... nosnappy ............................... yesglib ................................. yeszlib ................................. yesminizip .............................. yeslibevent ............................. yesjsoncpp .............................. yesprotobuf ............................. yeslibxml2 and libxslt .................. nolcms2 ................................ yespng .................................. noJPEG ................................. yesharfbuzz ............................. nofreetype ............................. yesxkbcommon ............................ no
Qt WebEngineCore:Embedded build ......................... noFull debug information ................. noPepper Plugins ......................... yesPrinting and PDF ....................... yesProprietary Codecs ..................... noSpellchecker ........................... yesNative Spellchecker .................... noWebRTC ................................. yesGeolocation ............................ yesWebChannel support ..................... yesKerberos Authentication ................ noExtensions ............................. yesSupport qpa-xcb ........................ yesUse ALSA ............................... yesUse PulseAudio ......................... yes
Qt WebEngineQml:Support Qt WebEngine Qml ............... yesUI Delegates ........................... yesTest Support ........................... no
Qt WebEngineWidgets:Support Qt WebEngine Widgets ........... yes
Qt PDF:Support V8 ............................. noSupport XFA ............................ noSupport XFA-BMP ........................ noSupport XFA-GIF ........................ noSupport XFA-PNG ........................ noSupport XFA-TIFF ....................... no
Qt PDF Widgets:Support Qt PDF Widgets ................. yes

4. 编译中遇到的问题:

  1. 编译到 ninja: Entering directory /opt/Qt5.15.0/Src/qtwebengine/src/core/release的时候莫名其妙死机,重启重新make仍然卡在这。
    解决办法: 反复查看文档,Google官网关于chromium的和qt的关于qtwebengine的,检查哪些库没有安装,安装几个尝试再次build发现可以。
  2. 编译过程中,特别是编译到最后的时候,会出现死机,鼠标键盘不能用的情况,只能重启,有时候管用,有时候重启之后编译一个之后又死机,这是因为板子cup核数4低于ninja默认核数6, 这时需要-j 降低线程数,make -j 2 或者 make -j 3
  3. 提示关于ninja的error.
    检查ninja版本是否正确,最好在 qtwebengine/src/3rdparty/ninja 中用自带的ninja源码编译生成的 ninja.
    如果直接使用开发板编译,建议将ninja编译使用cpu核心低于开发板核心(默认是用的6个核心,实际会根据硬件调整,如果默认值,遇到过死机情况)

Note

  1. 每次执行完qmake命令要删除config.cache, 清空缓存再执行qmake, 否则执行的结果还是上一次的.

这篇关于Build qt5.15.0 qtwebengine on SUSE SLE-15的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/911556

相关文章

Ilya-AI分享的他在OpenAI学习到的15个提示工程技巧

Ilya(不是本人,claude AI)在社交媒体上分享了他在OpenAI学习到的15个Prompt撰写技巧。 以下是详细的内容: 提示精确化:在编写提示时,力求表达清晰准确。清楚地阐述任务需求和概念定义至关重要。例:不用"分析文本",而用"判断这段话的情感倾向:积极、消极还是中性"。 快速迭代:善于快速连续调整提示。熟练的提示工程师能够灵活地进行多轮优化。例:从"总结文章"到"用

这15个Vue指令,让你的项目开发爽到爆

1. V-Hotkey 仓库地址: github.com/Dafrok/v-ho… Demo: 戳这里 https://dafrok.github.io/v-hotkey 安装: npm install --save v-hotkey 这个指令可以给组件绑定一个或多个快捷键。你想要通过按下 Escape 键后隐藏某个组件,按住 Control 和回车键再显示它吗?小菜一碟: <template

MCU7.keil中build产生的hex文件解读

1.hex文件大致解读 闲来无事,查看了MCU6.用keil新建项目的hex文件 用FlexHex打开 给我的第一印象是:经过软件的解释之后,发现这些数据排列地十分整齐 :02000F0080FE71:03000000020003F8:0C000300787FE4F6D8FD75810702000F3D:00000001FF 把解释后的数据当作十六进制来观察 1.每一行数据

Adblock Plus官方规则Easylist China说明与反馈贴(2015.12.15)

-------------------------------特别说明--------------------------------------- 视频广告问题:因Adblock Plus的局限,存在以下现象,优酷、搜狐、17173黑屏并倒数;乐视、爱奇艺播放广告。因为这些视频网站的Flash播放器被植入了检测代码,而Adblock Plus无法修改播放器。 如需同时使用ads

15 组件的切换和对组件的data的使用

划重点 a 标签的使用事件修饰符组件的定义组件的切换:登录 / 注册 泡椒鱼头 :微辣 <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-

flutter开发实战-flutter build web微信无法识别二维码及小程序码问题

flutter开发实战-flutter build web微信无法识别二维码及小程序码问题 GitHub Pages是一个直接从GitHub存储库托管的静态站点服务,‌它允许用户通过简单的配置,‌将个人的代码项目转化为一个可以在线访问的网站。‌这里使用flutter build web来构建web发布到GitHub Pages。 最近通过flutter build web,通过发布到GitHu

java基础总结15-面向对象11(抽象类)

下面通过一下的小程序深入理解抽象类 因此在类Animal里面只需要定义这个enjoy()方法就可以了,使用abstract关键字把enjoy()方法定义成一个抽象方法,定义如下:public abstract void enjoy();   从某种意义上来说,抽象方法就是被用来重写的,所以在父类声明的抽象方法一定要在子类里面重写。如果真的不想在子类里面重写这个方法,那么可以再在子类里

15年亚洲区长春站赛后总结

刷题打比赛的日子才叫青春   今年和ljy、lsj组队去长春站。这支队伍是我很放心的一支队伍,ljy可以做数学题和复杂思维题,lsj思维缜密可以和ljy对思路,我负责手速狗+模板暴力流。 有了去年两场亚洲区的经验,心态有了很大变化,也深知赛场上风云莫测,不至最后一分钟,仍未分胜负。开场的F题卡了很久,WA了很多发,这种复杂思维题丢给ljy和lsj搞了。我去开L题,给LJY说完题意后,他给

兔子-build.gradle中代码的含义

//声明构建的项目类型,这里当然是android了apply plugin: 'com.android.application'//设置编译android项目的参数android {// SDK的版本号,也就是API Level,例如API-19、API-20、API-21等等。compileSdkVersion 23//构建工具的版本,其中包括了打包工具aapt、dx等等。// 这个工具的目

找不同-第15届蓝桥省赛Scratch初级组真题第4题

[导读]:超平老师的《Scratch蓝桥杯真题解析100讲》已经全部完成,后续会不定期解读蓝桥杯真题,这是Scratch蓝桥杯真题解析第183讲。 如果想持续关注Scratch蓝桥真题解读,可以点击《Scratch蓝桥杯历年真题》并订阅合集,查阅教程更方便。 第15届蓝桥杯省赛已于2024年8月24日落下帷幕,编程题一共有5题,分别如下: 猪八戒落地 游乐场 画西瓜 找不同 消