Qt Include 和 QMake 错误

发布于 2024-12-26 00:40:25 字数 114 浏览 2 评论 0原文

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魔法唧唧 2025-01-02 00:40:25

假设您使用的是 Qt 的最新版本(例如版本 4.7.4)和 Qt Creator 的最新版本(例如分支 2.3.*)。

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

我们首先需要查明 Qt Creator 是否知道 Qt 安装在哪里。转到工具>选项...。然后点击Qt4。这里将显示所有已安装和检测到的 Qt 版本。

Detected Qt versions

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

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

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

更改项目的 Qt 版本

有任何问题请评论。对不起,令人毛骨悚然的英语。

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 .*.

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

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.

Detected Qt versions

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

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.

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.

Changing the project's Qt version

Any trouble just comment. Sorry about the creepy english.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文