Win7 64位 VS2012 安装 Qt5(测试可行)

来源:互联网 发布:java仓库管理系统论文 编辑:程序博客网 时间:2024/06/02 23:38

原文:http://www.tuicool.com/articles/NFv2iev 或 

http://www.cnblogs.com/luweimy/p/4141204.html


注意,本教程的操作系统为 Win7 64位,VS2012 英文版。

由于机器是64位,编译Qt的过程中,有可能出现如下问题。

  1. fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'  

按照下面的教程,可以解决上面的编译错误。 

1. 从 Qt 官网下载 qt-windows-opensource-5.1.0-msvc2012-x86_64-offline.exe,安装。

2. 下载 qt-vs-addin-1.2.2-opensource.exe,安装。

3. 添加环境变量 QTDIR,在我的机器上是下面的路径。

[plain]   view plain copy

  1. D:\Qt\Qt5.1.0\5.1.0\msvc2012_64  

4. 添加Qt Version。

点击VS2012的菜单QT5 -> Qt Options,在弹出的窗口中,点击Add,在Path的输入框中,输入下面的路径,注意对应修改为你机器上的路径。

  1. D:\Qt\Qt5.1.0\5.1.0\msvc2012_64  

5. 在VS2012中新建一个Qt Project,HelloQt

6. 在Solution Explorer右键点击项目HelloQt -> Properties,点击弹出窗口右上角的Configuration Manager,修改Platform为x64。

6. 在Solution Explorer右键点击项目HelloQt -> Properties -> Configuration Properties -> Linker -> Advanced,点击 Target Machine 修改为X64。

7. 在Solution Explorer右键点击项目HelloQt -> Qt Project Settings,在弹出的窗口中,点击Version的下拉框,选择msvc2012_64。

现在,Ctrl + F5 应该可以正常运行啦。如果还不行,在Solution Explorer右键点击项目HelloQt -> Rebuild。


0 0