如何在Visual Studio 2010中设置Qt路径? [英] How do I set up Qt paths in Visual Studio 2010?

查看:713
本文介绍了如何在Visual Studio 2010中设置Qt路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚下载并安装了最新版本的Qt SDK,Qt Creator和Visual Studio的Qt加载项(我正在运行VS 2010).

I just downloaded and installed the latest versions of the Qt SDK, Qt Creator, and the Qt add-in for Visual Studio (I'm running VS 2010).

首先,我尝试在VS2010中创建一个Qt项目.它想出了

First, I tried creating a Qt project in VS2010. It came up with

找不到Qt版本!

Unable to find a Qt build!

要解决此问题,请指定一个Qt版本

To solve this problem specify a Qt build

所以我去Qt-> VS中的"Qt选项"菜单项,然后单击添加"作为版本.

So I go to the Qt -> Qt Options menu item in VS and click Add for the version.

现在,我有2个qmake.exe文件:一个在C:\ Qt \ 2010.05 \ qt \ qmake中,另一个在C:\ Qt \ 2010.05 \ qt \ bin中

Now, I have 2 qmake.exe files: one in C:\Qt\2010.05\qt\qmake and one in C:\Qt\2010.05\qt\bin

由于某种原因,如果我选择这些文件之一,则会显示错误消息,说明此版本的Qt是使用MingW构建的. (我看不出为什么编译它会有所不同,只要编译就可以了?)

For some reason, if I select either one of these files, it comes up with the error message the this version of Qt was built with MingW. (I don't see why it makes a difference what compiled it, just so long as it's compiled?)

花了一些时间试图为VS加载项找到一个正常的qmake.exe之后,我放弃了,试图让原来的Qt创建者正常工作.

After spending some time trying to find a working qmake.exe for the VS add-in I gave up and tried to get the original Qt creator to work instead.

Qt创建者也未配置为自己运行(大声笑). 当我选择两个qmake.exe文件之一的路径时,当我尝试编译一个小程序时,它会显示一条错误消息:

Qt creator is also not configured to run with itself (lol). When I select the path to either of my 2 qmake.exe files, it comes up with an error message when I try to compile a small program:

找不到make命令:在构建环境中进行

Could not find make command: make in the build environment

构建无标题项目时发生错误(目标:桌面)

Error while building project untitled (target: Desktop)

在执行构建步骤制作"时

When executing build step 'Make'

当我检查Qt Creator中的选项时,它说qmake的版本为4.7.0,并且

When I check the options in Qt creator, it says qmake is at version 4.7.0 and that

Qt版本未正确安装,请运行make install

Qt version is not properly installed, please run make install

VS2010加载项已安装到我的程序文件(x86)文件夹中,但是那里没有qmake.exe文件.

The VS2010 add-in is installed to my program files (x86) folder, but there are no qmake.exe files there.

我正在运行Windows 7 x64.

I'm running Windows 7 x64.

推荐答案

使用vs2010对其进行重建,它非常容易,并且允许您在调试时进入Qt src.

Rebuild it with vs2010, it's much easier, and allows you to step into the Qt src in debug.

在Qt src树的顶部执行
configure -no-webkit -no-qt3support -opensource -platform win32-msvc2010
(webkit是可选的,但构建时间较长)

In the top of the Qt src tree do
configure -no-webkit -no-qt3support -opensource -platform win32-msvc2010
(webkit is optional but it takes a long time to build)

将构建一个.sln文件,您可以在VS2010中打开该文件并进行构建

Will build a .sln file which you can open in VS2010 and build

这篇关于如何在Visual Studio 2010中设置Qt路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆