qt5 源码编译

Posted 程序之家

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了qt5 源码编译相关的知识,希望对你有一定的参考价值。

源码 qt-everywhere-src-5.11.3

依赖

apt-get install bison build-essential gperf flex ruby python libasound2-dev libbz2-dev libcap-dev \
libcups2-dev libdrm-dev libegl1-mesa-dev libgcrypt11-dev libnss3-dev libpci-dev libpulse-dev libudev-dev \
libxtst-dev gyp ninja-build libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libicu-dev


不安装这些依赖库接下来运行configure的时候可能会报如下错误

WARNING: gperf is required to build QtWebEngine.

WARNING: bison is required to build QtWebEngine.

WARNING: flex is required to build QtWebEngine.

WARNING: host pkg-config not found

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.

 


如果发生类似这样的错 安装完相关依赖库之后 记得运行 rm config.cache来删除缓存的配置

./configure -prefix $PWD/qtbase -opensource -nomake examples -nomake tests
make -j 4
make install

以上是关于qt5 源码编译的主要内容,如果未能解决你的问题,请参考以下文章

QT5静态编译工程(arm交叉编译)

麒麟系统开发笔记:从Qt源码编译安装之编译安装Qt5.12

Qt5.12.x 编译QFtp项目

Qt5.12.x 编译QFtp项目

Win10 VS2015 静态编译Qt5.6.2源码

Qt5.7.0配置选项(configure非常详细的参数)