Qt 包含和 QMake 错误 [英] Qt Include and QMake error

查看:35
本文介绍了Qt 包含和 QMake 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Qt 在 Windows 上搞砸了,所以我删除了它,然后用 qt 库和 Qt Creator 重新安装它.现在,每当我尝试打开旧项目时,都会收到Qmake 不存在或不可执行"的错误消息,并且无法找到任何 Qt 头文件.

Qt was messing up on Windows so I deleted it and re installed it with the qt libraries and Qt Creator. Now, whenever I try to open my old project, I get the error that "Qmake is does not exist or is not executable", and none of the Qt headers can be located.

推荐答案

假设您使用的是最新版本的 Qt,例如 4.7.4 版本,以及最新版本的 Qt Creator,例如分支 2.3 .*.

Assuming you're using a recent version of Qt, such as version 4.7.4, and a recent version of Qt Creator, such as the branch 2.3 .*.

可能在此过程中的某个地方,Qt Creator 或此特定项目的设置丢失了对 Qt 安装的引用.

Probably somewhere in this process, Qt Creator or the settings for this specific project lost the reference to Qt install.

我们首先需要了解 Qt Creator 是否知道 Qt 的安装位置.转到<代码>工具>选项....然后在Qt4中点击.这里将显示所有已安装和检测到的 Qt 版本.

We first need to find out if Qt Creator knows where Qt is installed. Go to Tools > Options.... Then click in Qt4. Here will show all installed and detected Qt versions.

如您所见,我安装了一个 Qt 版本 (4.7.4),该版本是自动检测到的.

As you can see, I have one Qt version installed (4.7.4), which was automatically detected.

如果您没有安装任何版本,您需要手动指定一个.只需单击Add 并将其指向右侧的qmake.exe.使用图中的路径作为参考.如果你在开发windows/mingw应用,只需要添加mingw关联的qmake.exe(c:\qtsdk\desktop\qt\4.7.4\mingw\bin\qmake.exe 并记住版本名称,我们在下一步需要它.

If you do not have any installed version, you need to indicate a one manually. Simply click Add and point it to the right qmake.exe. Use the paths of the figure as reference. If you are developing a windows/mingw application, just need to add the qmake.exe associated with mingw (c:\qtsdk\desktop\qt\4.7.4\mingw\bin\qmake.exe on my computer) and remember the Version name, we'll need that in next step.

之后,打开项目并单击横向栏中的Projects.您需要替换 Qt 版本.点击旁边的Manage 并选择正确的版本.这应该可以解决问题.

After that, open the project and click on Projects in the lateral bar. You need to Substitute the Qt version. Click on Manage next to it and select the correct version. This should resolve the problem.

有什么问题请留言.对令人毛骨悚然的英语感到抱歉.

Any trouble just comment. Sorry about the creepy english.

这篇关于Qt 包含和 QMake 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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