正如标题所说,我无法将 QtWebWidgets 添加到任何 QT 项目中。我正在运行基于在 Linux Mint 17 中运行的 Qt 5.3.1 的 QT creator 3.2.0。当我添加
QT += webkitwidgets
对于我的 .pro 文件,我遇到了很多错误,这些错误表明编译器找不到文件,这里是编译器输出:
/usr/bin/ld: cannot find -lgio-2.0
/usr/bin/ld: cannot find -lgstapp-0.10
/usr/bin/ld: cannot find -lgstinterfaces-0.10
/usr/bin/ld: cannot find -lgstpbutils-0.10
/usr/bin/ld: cannot find -lgstvideo-0.10
/usr/bin/ld: cannot find -lgstbase-0.10
/usr/bin/ld: cannot find -lgstreamer-0.10
/usr/bin/ld: cannot find -lgobject-2.0
/usr/bin/ld: cannot find -lgmodule-2.0
/usr/bin/ld: cannot find -lxml2
/usr/bin/ld: cannot find -lgthread-2.0
/usr/bin/ld: cannot find -lglib-2.0
collect2: error: ld returned 1 exit status
make: *** [web_browser] Error 1
21:24:24: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project web_browser (kit: Desktop Qt 5.2.1 GCC 64bit)
When executing step "Make"
知道是什么导致了这些错误吗?
最佳答案
在 Ubuntu(或类似的)中安装
安装 g++
sudo apt-get install build-essential
安装 OpenGL 库
sudo apt-get install mesa-common-dev
sudo apt-get install libglu1-mesa-dev -y
执行此操作后:
sudo apt-get install libgstreamer1.0-dev
sudo apt-get install libgstreamer0.10-dev
sudo apt-get install libgstreamer-plugins-base1.0-dev
sudo apt-get install libgstreamer-plugins-base0.10-dev
和
sudo apt-get install qtbase5-dev
其他发行版(如 Debian)
安装 QT 后,在终端中使用 su
或 sudo
执行此命令
第一次更新(使用 su 或 sudo):
apt-get update
安装包后(使用 su 或 sudo):
apt-get install libxslt
apt-get install libxml2
apt-get install libgio2.0
apt-get install libgstapp0.10
apt-get install libgstinterfaces0.10
apt-get install libgstpbutils0.10
apt-get install libgstvideo0.10
apt-get install libgstbase0.10
apt-get install libgstreamer0.10
apt-get install libgobject2.0
apt-get install libgmodule2.0
apt-get install libgthread2.0
apt-get install libglib2.0
apt-get install libgl
关于c++ - 无法将 QtWebWidgets 添加到项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25630001/