使用 Visual Studio 2010 在 Windows 7 上构建 Qt
有人能够使用 Visual Studio 2010 在 Windows 7(64 位)上构建 Qt 吗?我尝试过不同的编译器和配置的 -no-webkit
选项,但每次 nmake 都会失败并出现错误代码 U1077。如果有建议,我们将非常感激。
Was anyone able to build Qt on Windows 7 (64-bit) with Visual Studio 2010? I've tried different compilers and the -no-webkit
option for configure, but every time nmake fails with error code U1077. Would be very greatful for suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用 VS2010 SP1 + Windows SDK 7.1(64 位发布环境)在 Windows 7 64 位(旗舰版)上成功编译了 64 位版本的 Qt 4.7.2(最小版)。
建议的安装顺序:
1.Visual Studio 2010
2.Windows SDK 7.1
3.Visual Studio 2010 SP1
4. Windows SDK 7.1 的 Visual C++ 2010 SP1 编译器更新
VS2010 已切换为使用 Windows SDK 7.1 作为默认平台工具集:
“C:\Program Files\Microsoft SDKs\Windows\v7.1\Setup\WindowsSdkVer.exe”-版本:v7.1
OpenSSL 64 位版本已按此处所述进行编译:
http://wiki.qt.io/Building_Qt_Desktop_for_Windows_with_MSVC#Building_OpenSSL
在这里:
http://wiki.openssl.org/index.php/Compilation_and_Installation#W64
OpenSSL 64位版本安装路径为:
“C:\Program Files\OpenSSL”
qt-everywhere-opensource-src-4.7.2.zip 的内容已在此处解压:
“C:\Program Files\Nokia\Qt 4.7.2”
为了配置构建环境,我使用了批处理脚本(setqtbuildenv.cmd),其内容如下:
@echo 关闭
echo 设置 Microsoft Windows SDK 7.1 环境
设置 WINSDKDIR=C:\Program Files\Microsoft SDKs\Windows\v7.1
调用“%WINSDKDIR%\Bin\SetEnv.cmd”/Release /x64 /win7
echo 设置 OpenSSL 环境
设置 OPENSSLDIR=C:\PROGRA~1\OpenSSL
设置 PATH=%OPENSSLDIR%\bin;%PATH%
设置 LIB=%OPENSSLDIR%\lib;%LIB%
设置 INCLUDE=%OPENSSLDIR%\include;%INCLUDE%
echo 设置Qt环境
设置 QTDIR=C:\PROGRA~1\诺基亚\QT47~1.2
设置 PATH=%PATH%;%QTDIR%\bin
cd /d "%QTDIR%"
configure.exe -release -opensource -shared -platform win32-msvc2010 -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-ltcg
最后使用了 nmake 命令。
I successfully compiled 64-bit version of Qt 4.7.2 (minimal) on Windows 7 64-bit (Ultimate) with VS2010 SP1 + Windows SDK 7.1 (64-bit release environment).
Installation order was as recommended:
1. Visual Studio 2010
2. Windows SDK 7.1
3. Visual Studio 2010 SP1
4. Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1
VS2010 have been switched to use Windows SDK 7.1 as a default Platform Toolset:
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Setup\WindowsSdkVer.exe" -version:v7.1
OpenSSL 64-bit version have been compiled as described here:
http://wiki.qt.io/Building_Qt_Desktop_for_Windows_with_MSVC#Building_OpenSSL
and here:
http://wiki.openssl.org/index.php/Compilation_and_Installation#W64
OpenSSL 64-bit version installation path was:
"C:\Program Files\OpenSSL"
Content of qt-everywhere-opensource-src-4.7.2.zip have been unpacked here:
"C:\Program Files\Nokia\Qt 4.7.2"
To configure build environment I used batch script (setqtbuildenv.cmd) with the following content:
@echo off
echo Setting Microsoft Windows SDK 7.1 Environment
set WINSDKDIR=C:\Program Files\Microsoft SDKs\Windows\v7.1
call "%WINSDKDIR%\Bin\SetEnv.cmd" /Release /x64 /win7
echo Setting OpenSSL Environment
set OPENSSLDIR=C:\PROGRA~1\OpenSSL
set PATH=%OPENSSLDIR%\bin;%PATH%
set LIB=%OPENSSLDIR%\lib;%LIB%
set INCLUDE=%OPENSSLDIR%\include;%INCLUDE%
echo Setting Qt Environment
set QTDIR=C:\PROGRA~1\Nokia\QT47~1.2
set PATH=%PATH%;%QTDIR%\bin
cd /d "%QTDIR%"
configure.exe -release -opensource -shared -platform win32-msvc2010 -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-ltcg
And finally nmake command have been used.
我遇到了同样的问题,最终放弃了从源代码构建并使用了二进制文件。到目前为止工作正常(因为我只将它用于我的图形课程项目)
I have had the same issue , ultimately gave up building from source and used the binary instead. Works fine so far (since i am only using it for my graphics course project)