問題描述
我應該采取哪些步驟來為 Visual Studio 2012 編譯 Qt(版本 4.8.x)?
我已經仔細遵循了這個問題的已接受答案中的說明(適用于 VS 2010),但 WebKit 模塊無法編譯(我不確定編譯期間是否記錄了錯誤消息).
我還看到了這個問題提出了相同的問題,但對于 VS 2012 RC(這就是為什么我認為這不會是一個重復的問題).此外,回答者說他已經為 VS 2011 Beta 編譯了 Qt,因此它可能不適用于 VS 2012 (RTM).編譯需要很多時間,這就是為什么我還沒有嘗試過.
我意識到至少有一個問題是 Qtmkspecs
中沒有 win32-msvc2012
目錄.我是否應該創建該目錄并從 win32-msvc2010
復制文件,可能需要進行一些修改?
另一個子問題是我是否應該在開始編譯之前對 Qt 源代碼進行一些修改.
Qt 4.8.3 with Visual Studio 2012 x64(也應該適用于 4.8.2)
安裝Strawberry Perl
從 http://qt-project.org/downloads
轉到
mkspecswin32-msvc2010
.打開qmake.conf
并修改:QMAKE_COMPILER_DEFINES += _MSC_VER=1600 WIN32
到:
QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32
將
qt-everywhere-opensource-src-4.8.3-x64src3rdpartywebkitSourceJavaScriptCorewtfHashSet.h
替換為 this.
啟動VS2012 x64 Native Tools 命令提示符"
切換到Qt 4.8.3源目錄(包含
configure.exe
的目錄)運行:
configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2010
后繼者:
nmake
我編寫了一個名為 BlueGo 的工具,它會自動下載 Qt 4.8.3 并使用 VS2012 x64 構建它:http://bluego.vertexwahn.de(也適用于 VS2010 x64)(它只是自動執行我上面描述的)
What steps should I take to compile Qt (version 4.8.x) for Visual Studio 2012?
I already carefully followed the instructions in the accepted answer of this question (which is for VS 2010), but WebKit module failed to compile (I'm not sure if the error message was logged anywhere during compilation).
I also saw this question which asks the same, but for VS 2012 RC (which is why I thought this wouldn't be a duplicate question). Furthermore, the answerer says he has compiled Qt for VS 2011 Beta, so there's a chance it may not work for VS 2012 (RTM). The compilation takes a lot of time, which is why I have not tried it yet.
At least one problem I realized is that there's no win32-msvc2012
directory in Qtmkspecs
. Should I just create that directory and copy the files from win32-msvc2010
, possibly with some modifications?
Another sub-question is whether I should make some modifications to Qt sources before starting compilation.
Qt 4.8.3 with Visual Studio 2012 x64 (should also work with 4.8.2)
Install Strawberry Perl
Download Qt 4.8.3 source code from http://qt-project.org/downloads
Go to
mkspecswin32-msvc2010
. Openqmake.conf
and change:QMAKE_COMPILER_DEFINES += _MSC_VER=1600 WIN32
to:
QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32
Replace
qt-everywhere-opensource-src-4.8.3-x64src3rdpartywebkitSourceJavaScriptCorewtfHashSet.h
by thisHashSet.h
.Start "VS2012 x64 Native Tools Command Prompt"
Switch to Qt 4.8.3 source directory (the directory that contains
configure.exe
)Run:
configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2010
Followed by:
nmake
I programmed a tool called BlueGo which automatically downloads Qt 4.8.3 and builds it with VS2012 x64: http://bluego.vertexwahn.de (also works with VS2010 x64) (it just does what I described above automatically)
這篇關于為 Visual Studio 2012 編譯 Qt 4.8.x的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!