Since QT officially did not release the precompiled 64-bit version of QT4, to use the 64-bit version of Qt4, can only compile themselves, the compilation process is as follows:
1, download the source code and extract to D:\qt-src\qt-everywhere-opensource-src-4.8.6, the path must not have spaces
2. Open the Visual Studio x64 Win64 Command Console and go to the appropriate directory.
D:
CD qt-src\qt-everywhere-opensource-src-4.8.6
3, setting environment variables
Set qtdir=d:\qt-src\qt-everywhere-opensource-src-4.8.6
Set qmakespec=win32-msvc2010
4, run configure, this command compiles the Qmake and generates the compilation script
Configue-platform Win32-msvc2010-opensource-fast-qt-style-windowsxp-qt-style-windowsvista-no-qt3support- Qt-sql-odbc-no-phonon-no-phonon-backend-no-script-no-scripttools-no-multimedia-nomake Examples-nomake Demos
5,4.8.x version of the source code, there is a character problem will cause the compilation can not pass, first open: <QT dir>\src\3rdparty\webkit\source\webcore\platform\ DefaultLocalizationStrategy.cpp file, find 327 lines in the original
Return web_ui_string ("Look Up" <selection> "", "Look up the context menu item with selected word"). Replace ("<selectio N> ", Truncatedstringforlookupmenuitem (selectedstring));
Change into
Return web_ui_string ("Look Up \" <selection>\ "", "Look up the context menu item with selected word"). Replace ("<select Ion> ", Truncatedstringforlookupmenuitem (selectedstring));
Is the quotation mark problem caused. If you do not change it, you will report an error like this:
Nmake:fatal error U1077: "CD": Return Code "0x2"
Stop.
Nmake:fatal error U1077: "CD": Return Code "0x2"
Stop.
6, run NMAKE, start compiling, normally it will be compiled in a few hours.
7, run cleanup, there are several cleaning options, according to their own circumstances to choose.
NMAKE clean cleans up intermediate files
NMAKE Confclean Cleanup Configuration
NMAKE Distclean all clean up, if you want to recompile, use this option
done!
Reference Links:
Http://blog.sina.com.cn/s/blog_671c54fe0100w0qz.html
http://blog.csdn.net/taigw/article/details/38130735
http://bbs.csdn.net/topics/380153284
Http://www.tuicool.com/articles/IvURFfa
Http://doc.qt.io/qt-4.8/install-win.html
Windows 7 + VS2010 SP1 compiled x64-bit version Qt4