简体   繁体   English

无法打开包含文件:'QWebView':没有这样的文件或目录

[英]Cannot open include file: 'QWebView': No such file or directory

I have followed the instructions on the following page: 我已按照以下页面上的说明操作:

http://qt-project.org/wiki/Open_Web_Page_in_QWebView http://qt-project.org/wiki/Open_Web_Page_in_QWebView

I added QT += webkit in my pro file and ran qmake, then clean all and compile again. 我在我的pro文件中添加了QT + = webkit并运行了qmake,然后清理所有并再次编译。 I still get: 我还是得到:

error: C1083: Cannot open include file: 'QWebView': No such file or directory 错误:C1083:无法打开包含文件:'QWebView':没有这样的文件或目录

when I add #include <QWebView> in header and cpp file. 当我在header和cpp文件中添加#include <QWebView>时。 Any ideas? 有任何想法吗?

我不得不在专业文件中添加QT += webkit webkitwidgets以使其正常工作。

我必须为我的应用程序添加libqtwebkit-dev包进行编译。

It works fine for me, on a mac with homebrew install. 它对我来说很好,在带有自制软件安装的mac上。

Open the Makefile generated by qmake 打开qmake生成的Makefile

There should be a variable called INCPATH , and one of the paths listed should end with /include . 应该有一个名为INCPATH的变量,其中一个列出的路径应以/include结尾。

List this directory and make it exists, and the many QXXXX directories and header files are present (in particular QWebKit). 列出此目录并使其存在,并且存在许多QXXXX目录和头文件(特别是QWebKit)。

If everything seems to be ok, please detail how you are naming the files and what commands are you using to generate the makefile with qmake and then compiling. 如果一切似乎都没问题,请详细说明如何命名文件以及使用qmake生成makefile然后编译的命令。

I ran into the same issue on Kubuntu 18.10. 我在Kubuntu 18.10遇到了同样的问题。 My development environment was for Qt5 and I needed to install 我的开发环境适用于Qt5,我需要安装

libqt5webkit5-dev libqt5webkit5-dev的

apt install libqt5webkit5-dev apt install libqt5webkit5-dev

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用Qt打开包含文件:“无此文件或目录” - Cannot open include file with Qt: “No such file or directory” Qt 无法打开包含文件:&#39;QNetworkAccessManager&#39;:没有这样的文件或目录 - Qt Cannot open include file: 'QNetworkAccessManager': No such file or directory 无法打开包含文件:&#39;graphics.h&#39;:没有这样的文件或目录 - Cannot open include file: 'graphics.h': No such file or directory 无法打开包含文件:&#39;d3dx9.h&#39;:没有这样的文件或目录 - Cannot open include file: 'd3dx9.h': No such file or directory Visual Studio无法打开包含文件;不能打开包含文件。 没有相应的文件和目录 - Visual Studio Cannot open include file; No such file or directory 无法打开包含文件“windows.h”没有这样的文件或目录 - Cannot open include file “windows.h” No such file or directory 无法打开包含文件:“unistd.h”:没有这样的文件或目录 - Cannot open include file: 'unistd.h': No such file or directory 无法打开包含文件:&#39;cpprest/ws_client&#39;:没有这样的文件或目录 - Cannot open include file: 'cpprest/ws_client': No such file or directory 无法打开包含文件:&#39;VersionHelpers.h&#39;:没有这样的文件或目录 - Cannot open include file: 'VersionHelpers.h': No such file or directory 无法打开包含文件:&#39;ctype.h&#39;:没有这样的文件或目录 - Cannot open include file: 'ctype.h': No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM