Qt Creator 编译器配置问题 [英] Qt Creator Compiler Config Issue

查看:120
本文介绍了Qt Creator 编译器配置问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始学习 C++,并遇到了 Qt Creator.我已将它与内置的 MinGW 编译器一起安装.但是,我无法让我的项目构建并运行".我在下面附上了一些屏幕截图,感谢您的帮助!

I have just started to learn C++ and have come across Qt Creator. I have installed it alongside the built in MinGW Compiler. However I cannot get my projects to 'Build and Run'. I have attached some screenshots below, thank you for any help!

最后一张图片显示了我可以选择的两个自动检测套件.我尝试创建自己的工具包并将其与编译器链接,因为自动检测的工具包没有链接到它的编译器.

The last image shows the two auto-detected kits which I can choose from. I tried creating my own kit and linked it with the compiler since the auto-detected kits don't have the compiler linked to it.

此外,当我尝试构建并运行"我的项目时会显示以下错误:

Also, the following error shows when I try to 'Build and Run' my project :

18:02:25:配置有问题.查看问题视图了解详细信息.构建/部署项目测试时出错(套件:桌面 Qt 5.6.0 MSVC2015 64 位)执行步骤Make"时

推荐答案

干货:

  • 您已经安装了版本 5.6 和 5.7 的 Qt 发行版(库、包含文件等),这些版本专为与 Visual Studio C++ 2015 编译器一起使用而构建.
  • 您没有 Visual Studio 2015 C++ 编译器(或未正确设置)
  • 您已经安装了 MinGW 4.9.2,它是 GCC 编译器的 Windows 端口.
  • 您还没有为 MinGW 安装 Qt

问题:

  • 由于 C++ 编译器之间缺乏二进制兼容性,使用一个编译器构建的 Qt 发行版(与任何其他库相同)无法与使用另一个编译器编译的代码链接.QtCreator 知道这一点并警告您.

可能的解决方案:

  • 为 MinGW 安装 Qt(在 Qt 文件夹中使用 maintenancetool.exe)

  • Install Qt for MinGW (with maintenancetool.exe in Qt folder)

安装 Visual Studio 2015(确保在安装过程中检查C++ 工具")

Install Visual Studio 2015 (make sure you check "C++ tools" during installation)

同时安装

安装其他匹配对{编译器,Qt_distribution }

Install other matching pairs of { compiler, Qt_distribution }

(在最后两种情况下,您可以轻松地在工具链之间切换)

(in last two cases you can easily swap between toolchains)

确保回滚对 QtCreator 中的编译器设置造成的任何损坏.

Make sure you roll back any damage you've made to compiler settings in QtCreator.

另见:安装 Qt 5.6:我应该选择哪些组件?

这篇关于Qt Creator 编译器配置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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