PDA

View Full Version : QWebView undefined references



xtreme
26th July 2008, 16:02
Hello,
I am trying to use the QWebView class to display html pages.
But I am unable to compile. I am using the following code:


#include <QWebView>
MainWindow::MainWindow()
{
QWebView *view = new QWebView(this);
view->load(QUrl("http://www.trolltech.com/"));
view->show();
Setup(this);
}

I then added to "INCPATH " -I"n:\Qt\4.4.0\include\QtWebKit"
and to the lib: -QtWebKit4

But i keep getting the following error:



release/mainwindow.o(.text+0x34c4):mainwindow.cpp: undefined reference to `_imp_
__ZN8QWebViewC1EP7QWidget'
release/mainwindow.o(.text+0x3527):mainwindow.cpp: undefined reference to `_imp_
__ZN8QWebView4loadERK4QUrl'
release/mainwindow.o(.text+0x36f4):mainwindow.cpp: undefined reference to `_imp_
__ZN8QWebViewC1EP7QWidget'
release/mainwindow.o(.text+0x3757):mainwindow.cpp: undefined reference to `_imp_
__ZN8QWebView4loadERK4QUrl'


Any help would be appriciated.
Thanks in advance.
-xtreme

jpn
26th July 2008, 17:02
I then added to "INCPATH " -I"n:\Qt\4.4.0\include\QtWebKit"
and to the lib: -QtWebKit4
Just add "QT += webkit" to the .pro file.

xtreme
28th July 2008, 08:08
Thanks, it works.