请教Qt高手:我安装Qt4.7.4后不能使用QWebKit,原文如下,如能帮助,不胜感激。对了,我用的是Win7
//main.cpp#include<QApplication>#include<QtWebKit/QWebView>#include<QtGui>intmain(int...
//main.cpp
#include <QApplication>
#include <QtWebKit/QWebView>
#include <QtGui>
int main(int argc, char* argv[])
{
QApplication app(argc,argv);
QWebView view;
view.load(QUrl("http://www.baidu.com"));
view.show();
return app.exec();
}
//test.pro
CONFIG += Qt
Qt += webkit
SOURCES += \
main.cpp
错误提示:
正在启动 "C:\QtSDK\mingw\bin\mingw32-make.exe"
{1"?} {2?}
C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `D:/MyQt/GUILearning/testperl-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK____'
g++ -mthreads -Wl,-subsystem,windows -o debug\testperl.exe debug/main.o -L"c:\QtSDK\Desktop\Qt\4.7.4\mingw\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4 -LC:\OpenSSL-Win32_full\lib
mingw32-make[1]: Leaving directory `D:/MyQt/GUILearning/testperl-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK____'
debug/main.o: In function `Z5qMainiPPc':
D:\MyQt\GUILearning\testperl-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK____/../testperl/main.cpp:9: undefined reference to `_imp___ZN8QWebViewC1EP7QWidget'
D:\MyQt\GUILearning\testperl-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK____/../testperl/main.cpp:10: undefined reference to `_imp___ZN8QWebView4loadERK4QUrl'
D:\MyQt\GUILearning\testperl-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK____/../testperl/main.cpp:13: undefined reference to `_imp___ZN8QWebViewD1Ev'
D:\MyQt\GUILearning\testperl-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK____/../testperl/main.cpp:13: undefined reference to `_imp___ZN8QWebViewD1Ev'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\testperl.exe] Error 1
mingw32-make: *** [debug] Error 2
进程"C:\QtSDK\mingw\bin\mingw32-make.exe"退出,退出代码 2 。
构建项目testperl 时发生错误 (目标: 桌面)
当执行构建步骤 'Make'时 展开
#include <QApplication>
#include <QtWebKit/QWebView>
#include <QtGui>
int main(int argc, char* argv[])
{
QApplication app(argc,argv);
QWebView view;
view.load(QUrl("http://www.baidu.com"));
view.show();
return app.exec();
}
//test.pro
CONFIG += Qt
Qt += webkit
SOURCES += \
main.cpp
错误提示:
正在启动 "C:\QtSDK\mingw\bin\mingw32-make.exe"
{1"?} {2?}
C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `D:/MyQt/GUILearning/testperl-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK____'
g++ -mthreads -Wl,-subsystem,windows -o debug\testperl.exe debug/main.o -L"c:\QtSDK\Desktop\Qt\4.7.4\mingw\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4 -LC:\OpenSSL-Win32_full\lib
mingw32-make[1]: Leaving directory `D:/MyQt/GUILearning/testperl-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK____'
debug/main.o: In function `Z5qMainiPPc':
D:\MyQt\GUILearning\testperl-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK____/../testperl/main.cpp:9: undefined reference to `_imp___ZN8QWebViewC1EP7QWidget'
D:\MyQt\GUILearning\testperl-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK____/../testperl/main.cpp:10: undefined reference to `_imp___ZN8QWebView4loadERK4QUrl'
D:\MyQt\GUILearning\testperl-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK____/../testperl/main.cpp:13: undefined reference to `_imp___ZN8QWebViewD1Ev'
D:\MyQt\GUILearning\testperl-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK____/../testperl/main.cpp:13: undefined reference to `_imp___ZN8QWebViewD1Ev'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\testperl.exe] Error 1
mingw32-make: *** [debug] Error 2
进程"C:\QtSDK\mingw\bin\mingw32-make.exe"退出,退出代码 2 。
构建项目testperl 时发生错误 (目标: 桌面)
当执行构建步骤 'Make'时 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询