PDA

View Full Version : undefined reference to `QWebView::QWebView(QWidget*)'



cmpscabral
5th July 2010, 19:37
Hi,

I'm trying to build a browser app, just to test Qt. this is my program so far:


#include <QApplication>
#include <QtWebKit/QWebView>

int main(int argc, char **argv)
{
QApplication app(argc, argv);
QWebView *view = new QWebView();

view->load(QUrl("http://www.yahoo.com"));
view->show();

return app.exec();
}

all I get is a undefined reference to `QWebView::QWebView(QWidget*)'

what am I doing wrong?

thanks

tbscope
5th July 2010, 19:44
Did you add the following line to your .pro file?


QT += webkit

Zlatomir
5th July 2010, 19:49
Add the following line to the project file (.pro file)

QT += webkit
And then Rebuild (or Clean All and then Rebuild)

cmpscabral
6th July 2010, 14:52
working! thanks both!

raevilman
13th March 2011, 11:29
i have already added that in project file but in vain.
not able to get rid of that error:

Zlatomir
13th March 2011, 12:14
@raevilman: Post the code which uses QWebView.
And have you tried Rebuild or Clean All then Rebuild?

yanike
3rd November 2011, 02:08
Add the following line to the project file (.pro file)

QT += webkit
And then Rebuild (or Clean All and then Rebuild)

Thanks! I was just about to try this and now I'm confident that it will work.

vvinayagar
23rd August 2013, 10:29
New QT 5.0 need to use <QtWebKitWidget/QWebView>

and need add

QT +=webkitwidget

marksh
3rd September 2013, 09:51
1) download last version Qt >= 5.1
2) #include <QtWebKitWidgets/QWebView>
3) in *.pro add webkitwidgets :
QT += core gui webkitwidgets
4) to use:
webView->load(QUrl(lineEdit->text()));