Ubuntu下编译Qt5.15源码

2023-12-26 15:35:43

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编译问题

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