先参考官方链接说明qtwebkit,下载源码,安装好相应的组件;
设置好相应的环境变量,包括WEBKITDIR等环境变量的设置;
可能出现的错误:
1、SQLite错误,以下可参考
Hi, QtWebKit requires SQLite for various web related storage mechanism (including cookies). That dependency is quite old actually, but we've done some changes now that clean up the way that dependency is satisfied. Ideally should affect only very few people, but it is quite likely to include folks cross-compiling Qt, targetting Linuxy platforms. The new state of the SQLite dependency union therefore is: (1) WebKit will try to use pkg-config to detect and use SQLite from the system. Alternatively on Mac OS X sqlite is always availble as a system library and conveniently used from there. (2) If option number 1 doesn't apply, then we try to see if QtWebKit is being built as part of a qt5.git checkout (same applies to release tarballs) and we will try to compile in a copy of SQLite right into QtWebKit, the copy that's distributed in qtbase/src/3rdparty/sqlite. (3) If we also fail to locate Qt's copy of sqlite, then we do require the SQLITE3SRCDIR environment variable to be set to point to a location where the sources can be found. qtbase/src/3rdparty/sqlite is one such location. Folks cross-compiling are likely to miss case (1) and might consider enabling the use of pkg-config. Folks compiling on Windows should consider building under qt5/ or setting the SQLITE3SRCDIR environment variable.如果还有其他错误,建议先运行./Tools/Script/update-webkit,脚本
相关错误解决参考链接
结果又来个因为
NETSCAPE_PLUGIN_API宏导致的错误
真是难搞,都想放弃了。。。。。。
附上相关脚本:
"D:\Program Files (x86)\Microsoft Visual Studio 10.0\vc\bin\vcvars32.bat"
set CL= /MP
set WEBKIT_DIR=d:\Downloads\webkit_tool\WebKit
set WEBKITLIBRARIESDIR=%WEBKIT_DIR%\WebKitLibraries\win
set WEBKITOUTPUTDIR=D:\Downloads\webkit_tool\webkit_out
set SQLITE3SRCDIR=C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\src\3rdparty\sqlite
set WEBKIT_DIR=C:\Qt\Qt5.0.2\5.0.2\Src\qtwebkit
set PATH=%PATH%;d:\Downloads\webkit_tool\icu\bin
set INCLUDE=%INCLUDE%;D:\Downloads\webkit_tool\icu\include
set LIB=%LIB%;D:\Downloads\webkit_tool\icu\lib
perl .\Tools\Scripts\build-webkit --qt --debug
-[no-]netscape-plugin-api