C++ Qt Creator - 如何添加编译器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14464075/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 18:21:40  来源:igfitidea点击:

Qt Creator - How to add a compiler?

c++qt

提问by Hyman Willson

Possible Duplicate:
VC++ compiler for Qt Creator
QT5 beta2, QT creator 2.6, MSVC error: Qt Creator needs a compiler set up to build. Configure a compiler in the kit options

可能的重复:
用于 Qt Creator QT5 beta2、QT creator 2.6、MSVC 错误的VC++ 编译器
:Qt Creator 需要设置编译器来构建。在套件选项中配置编译器

I just installed Qt Creator ( my first expcerience with it ) and I'm getting this error, when I try to compile:

我刚刚安装了 Qt Creator(我第一次使用它),当我尝试编译时出现此错误:

-1: error: Qt Creator needs a compiler set up to build. Configure a compiler in the kit options.

-1: error: Qt Creator needs a compiler set up to build. Configure a compiler in the kit options.

It's indeed very suggesting, and I read on other post here on stack, but I just couldn't get it done. These are my options from Build&Run -> Compilers:enter image description here

这确实很有建议,我在堆栈上的其他帖子中阅读过,但我无法完成。这些是我在 Build&Run -> Compilers 中的选项:在此处输入图片说明

Details:

细节:

  1. It's Qt Creator 2.6.1 Based on Qt 5.0.0 (32 bit)
  2. I've installed visual studio 2012
  3. On the Qt download page , for Windows, there was only 32 bit option, but I have Windows 7 64bit
  1. 它是基于 Qt 5.0.0(32 位)的 Qt Creator 2.6.1
  2. 我已经安装了 Visual Studio 2012
  3. 在 Qt 下载页面上,对于 Windows,只有 32 位选项,但我有 Windows 7 64 位

LE: These are Kits options enter image description here

LE:这些是套件选项 在此处输入图片说明

What paths must be specified for Sysroot and Qt mkspec?

必须为 Sysroot 和 Qt mkspec 指定哪些路径?

采纳答案by Reza Ebrahimi

you are using Visual Studio 2012, The solutions:

您使用的是 Visual Studio 2012,解决方案:

1) remove it and reinstall Visual Studio 2010, Qt 5.0 works with this version of microsoft C/C++ compiler.

1) 删除它并重新安装 Visual Studio 2010,Qt 5.0 可与此版本的 Microsoft C/C++ 编译器一起使用。

2) install mentioned SDK compiler direclty from microsft's website.

2) 从 microsft 的网站安装提到的 SDK 编译器目录。