写在前面
笔者的测试环境:Ubuntu 18.04
一、问题描述
编译报错:
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5WebKit/WebKitTargets.cmake:90 (message):
The imported target "Qt5::WebKit" references the file
"/usr/lib/x86_64-linux-gnu/libQt5WebKit.so.5.212.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib/x86_64-linux-gnu/cmake/Qt5WebKit/WebKitTargets.cmake"
but not all the files it references.
报错截图:
二、解决方法
出现这个问题的主要原因是:libQt5WebKit.so.5
包未安装,或者未完整安装导致的。重新安装即可。
方法一:二进制安装
sudo apt-get install libqt5webkit5
方法二:deb安装
Ubuntu 18.04 的qt5webkit5包的 官方介绍网站 。
里面提到了deb包的下载链接: http://archive.ubuntu.com/ubuntu/pool/universe/q/qtwebkit-opensource-src/libqt5webkit5_5.212.0~alpha2-7ubuntu1_amd64.deb
或者点击下列链接进行CSDN免积分下载(不需要CSDN积分):
https://download.csdn.net/download/qq_39779233/87374948
直接进入上述下载链接,然后下载得到 libqt5webkit5_5.212.0~alpha2-7ubuntu1_amd64.deb
。
然后使用如下命令进行安装
sudo dpkg -i libqt5webkit5_5.212.0~alpha2-7ubuntu1_amd64.deb
然后再次编译程序,即可解决上述报错。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)