解開 QtWeb 的原始碼,有給 VS 的專案檔,很好。再看了一下依存性,發現還要加上 Qt 跟 OpenSSL 才能動工。尤其 Build Qt 實在是相當花時間的一件事,檔案也不小,看來當初應該直接挑戰 Chromium 的,不應該看到 2 GB 的壓縮檔就退卻了。
不過還是紀錄一下 Build QtWeb 的過程吧。
1. Download source code package, QtWeb.
2. Download the dependency packages, including Qt & OpenSSL.
3. Install OpenSSL.
4. Install Qt and then build Qt first. // Update: No need to re-build it since the package contains the built binaries.
Launch "Qt 4.8.4 Command Prompt", could be found in Start Menu, after installing Qt Libraries.Type 'configure -openssl -openssl-linked -I\include -L ' and press Enter.\lib\VC\static OPENSSL_LIBS="-lUser32 -lAdvapi32 -lGdi32 -lCrypt32" OPENSSL_LIBS_DEBUG="-lssleay32MDd -llibeay32MDd" OPENSSL_LIBS_RELEASE="-lssleay32MD -llibeay32MD" Type 'nmake' and press Enter.
- Control panel / Region and Language / Administrative / Language for Non-Unicode programs > English (US)
- Refer to this: http://blog.csdn.net/skyxfire/article/details/7369387
- Remember to reset the language setting after building program if necessary.
- Launch "Qt 4.8.4 Command Prompt" and cd to the QtWeb source folder, ex. cd D:\QtWb_src_3.7.5-101\QtWeb.
- Type build.cmd and press Enter.
- Launch VS 2008 via running "Visual Studio with Qt 4.8.4".
- Open QtWeb project in VS 2008.
- Build the project.
對了,Qt 編譯過後,Qt components 都是 Qtxxx4.lib/dll 的名稱,所以 QtWeb 在編譯時,順手改一下 Project settings,以免 link 時找不到檔案。研究一下 QtWeb 先,再來試試 Chromium。若是在 Compile Qt 有問題,也可以參考一下底下這篇。
How to compile Qt with Visual Studio