qmake - x64 Visual Studio 解决方案的 x64 makespec?
我们当前使用 qmake 和 .pro 文件为 Visual Studio 2008 创建项目,但默认解决方案平台是 Win32。每次重建项目时,我都必须通过进入配置管理器并从 Win32 解决方案复制设置来手动将平台更改为 x64。
我无法在在线/QT 论坛中找到自动创建为 x64 构建配置的 VS2008 解决方案的方法。我需要为 QT 创建自己的 makespec 吗?我需要指定特定于 x64 的 VS 标志吗?有谁可以发布一个他们已成功用于创建 x64 规范项目的示例吗?
We're currently using qmake and .pro files to create projects for Visual Studio 2008, but the default solution platform is Win32. Every time the projects are rebuilt, I have to manually change the platform to x64 by going into the configuration manager and copying settings from the Win32 solution.
I have not been able to find online/QT forums a way to automatically create a VS2008 solution configured for a x64 build. Do I need to create my own makespec for QT? Do I need to specify x64-specific VS flags? Does anyone have an example they can post which they've successfully used for creating x64-spec projects?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是一个已知问题。 Qt bugtracker 中有几个相关错误:QTBUG-6910 和 < a href="https://bugreports.qt-project.org/browse/QTBUG-4046" rel="nofollow">QTBUG-4046。第二个条目还包含一个补丁的链接,如果您自己构建 Qt,则可以使用该补丁。投票支持修复这些错误,以提高此问题的可见性。
This is a known issue. There are a couple of relevant bugs in the Qt bugtracker: QTBUG-6910 and QTBUG-4046. This second entry also has a link to a patch that you can use if you are building Qt yourself. Vote for those bugs to be fixed to increase the visibility of this issue.
感谢 the_mandrill,这就是解决方案:
首先,您需要下载补丁 3891 。然后,你需要应用补丁 - 你可以找到一个适用于 Windows 的补丁实用程序,但我只是手动编辑了补丁中的差异文件;文件位于 \qmake\generators\win32
然后,您需要从头开始构建 QT,这是通过在命令提示符中导航来完成的(确保它是 Visual Studio 中的 Visual Studio 2008 x64 命令提示符)目录)到您安装 QT 的目录,大概是 C:/QT/4.7.0,然后键入 configure,然后键入 nmake。
构建QT需要很长时间。同时,将这些添加到您的 qmake 文件中将自动检测您的主机操作系统。请记住,此解决方案不会在 x64 上同时生成 win32 和 x64 配置 - 仅生成 x64 配置。
这会生成一个工作的 x64 Visual Studio 解决方案,编译和链接时不会出现错误。
Thanks to the_mandrill, this is the solution:
First, you need to download patch 3891. Then, you need to apply the patch - you could find a patch utility for windows, but I just edited the files diffed in the patch manually; the files are in \qmake\generators\win32
Then, you need to build QT from scratch, which is done by navigating in command prompt (make sure it's the Visual Studio 2008 x64 command prompt from the Visual Studio directory) to the directory you installed QT in, presumably C:/QT/4.7.0, and typing configure, then nmake.
Building QT will take a long time. In the meantime, adding these to your qmake files will automatically detect your host OS. Keep in mind that this solution does NOT produce both win32 and x64 configurations on x64 - only the x64 configuration.
This produces a working x64 Visual Studio solution that compiles and links without errors.
这个问题在 4.8 中得到了修复。
您需要从 VS x64 命令提示符运行 qmake,以便它可以检测 PATH 变量中的 amd64 编译器。
This was fixed in 4.8.
You need to run qmake from a VS x64 command prompt so it can detect the amd64 compiler in the PATH variable.