Ubuntu1804编译QWebEngine

  • 编译环境:Ubuntu1804+Qt5.13.2
  • 在终端命令框转到qtwebengine源码路径
cd /opt/Qt5.13.2/5.13.2/Src/qtwebengine
  • 执行qmake,并增加编译参数
/opt/Qt5.13.2/5.13.2/gcc_64/bin/qmake 
 WEBENGINE_CONFIG+=use_proprietary_codecs qtwebengine.pro

Ubuntu1804编译QWebEngine_第1张图片

  • 编译中遇到的文件解决 

1.错误:Host pkg-config is required

解决:删除config.cache后执行apt-get install pkg-config

2.错误:khronos development headers appear to be missing (mesa/libegl1-mesa-dev)

解决:apt-get install libegl1-mesa-dev

3.错误:A suitable version of nss could not be found.

解决:apt-get install libnss3-dev

4.错误:A suitable version of dbus could not be found.

解决:

apt-get install dbus

apt-get install dbus-tests

apt-get install libdbus-glib-1-dev

5.错误:A suitable version of fontconfig could not be found

解决:apt install libfontconfig1-dev -y

6.错误:Could not find all necessary libraries for qpa-xcb support

解决:apt install libxcursor-dev

           apt install libxcomposite-dev

           apt install libdrm-dev

           apt install libxtst-dev -y

Ubuntu1804编译QWebEngine_第2张图片

  •  有如下显示时,则代表qmake正常

Ubuntu1804编译QWebEngine_第3张图片

  • 在当前目录执行make,本人8G内存虚拟机编译用时7小时
  • make执行完后执行make install

 编译完后的库文件下载

Ubuntu1804编译QWebEngine_第4张图片

你可能感兴趣的:(linux,qt)