Ubuntu下编译Qt5.15源码

发布时间:2023年12月26日

1.下载最新Qt代码

wget https://download.qt.io/official_releases/qt/5.15/5.15.12/single/qt-everywhere-opensource-src-5.15.12.tar.xz
# 解压
tar -xJf qt-everywhere-opensource-src-5.15.12.tar.xz

2.编译

./configure -opensource -confirm-license -verbose -release -mp -icu -qt-pcre -qt-zlib -openssl -opengl dynamic -qt-freetype -qt-harfbuzz -qt-libpng -qt-libjpeg -no-sql-mysql -qt-sqlite -qt-tiff -qt-webp -webengine-proprietary-codecs -nomake tests -nomake examples -skip qtdoc -skip qtquickcontrols -skip qtscript -skip qtxmlpatterns

2.1 第一个错误

报错信息:

ERROR: Feature 'icu' was enabled, but the pre-condition 'libs.icu' failed.

2.2 第二个错误

ERROR: The OpenGL functionality tests failed!
You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2],
QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.

2.3 解决,调整configure 命令行

./configure -opensource -confirm-license -verbose -release -nomake tests -nomake examples

这里注意,QtWebEngine QtPdf 无法正确编译,将跳过
我这里先忽略,直接执行:

make -j8

3.后续研究QtWebEngine编译问题

Qt WebEngine Build Tools:
  Use System Ninja ....................... no
  Jumbo Build Merge Limit ................ 8
  Developer build ........................ no
  Sanitizer .............................. no
  QtWebEngine required system libraries:
    fontconfig ........................... no
    dbus ................................. no
    nss .................................. no
    khr .................................. yes
    glibc ................................ yes
  Optional system libraries used:
    re2 .................................. no
    icu .................................. no
    libwebp, libwebpmux and libwebpdemux . no
    opus ................................. no
    ffmpeg ............................... no
    libvpx ............................... no
    snappy ............................... no
    glib ................................. no
    zlib ................................. yes
    minizip .............................. no
    libevent ............................. no
    libxml2 and libxslt .................. no
    lcms2 ................................ no
    png .................................. no
    JPEG ................................. no
    harfbuzz ............................. no
    freetype ............................. no

文章来源:https://blog.csdn.net/p309654858/article/details/135220237
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。