我用的是Qt Creater ,我在主
窗口上拖拽了一个QTabWidget控件,在QTabWidget的tab_1里拖拽了一个QWebView控件,同时在头
文件和
pro文件里分别添加了#include <QtWebKitWidgets/QWebView> QT +=
webkit ,在
编译的时候还是报很多
错误mainwindow.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall QWebView::setUrl(class QUrl const &)" (
__imp_?setUrl@QWebView@@QAEXABVQUrl@@@Z)
mainwindow.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QWebView::QWebView(class QWidget *)" (
__imp_??0QWebView@@QAE@PAVQWidget@@@Z)
mainwindow.obj : error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall QWebView::metaObject(void)const " (?metaObject@QWebView@@UBEPBUQMetaObject@@XZ)
mainwindow.obj : error LNK2001: 无法解析的外部符号 "public: virtual void * __thiscall QWebView::qt_metacast(char const *)" (?qt_metacast@QWebView@@UAEPAXPBD@Z)
mainwindow.obj : error LNK2001: 无法解析的外部符号 "public: virtual int __thiscall QWebView::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@QWebView@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
mainwindow.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall QWebView::event(class QEvent *)" (?event@QWebView@@UAE_NPAVQEvent@@@Z)
mainwindow.obj : error LNK2001: 无法解析的外部符号 "public: virtual class QSize __thiscall QWebView::sizeHint(void)const " (?sizeHint@QWebView@@UBE?AVQSize@@XZ)
mainwindow.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall QWebView::mousePressEvent(class QMouseEvent *)" (?mousePressEvent@QWebView@@MAEXPAVQMouseEvent@@@Z)
mainwindow.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall QWebView::mouseReleaseEvent(class QMouseEvent *)" (?mouseReleaseEvent@QWebView@@MAEXPAVQMouseEvent@@@Z)
mainwindow.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall QWebView::mouseDoubleClickEvent(class QMouseEvent *)" (?mouseDoubleClickEvent@QWebView@@MAEXPAVQMouseEvent@@@Z)
mainwindow.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall QWebView::mouseMoveEvent(class QMouseEvent *)" (?mouseMoveEvent@QWebView@@MAEXPAVQMouseEvent@@@Z)