尝试在 OS X 上安装 Qt 提示“您需要安装 Xcode 5.0.0”,但此版本太旧,无法使用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31554125/
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-09-15 07:31:34  来源:igfitidea点击:

Attempt to install Qt on OS X gives 'You need to install Xcode 5.0.0', but this version is so old it's not available

xcodemacosqtosx-yosemite

提问by Dan Nissenbaum

I am a Windows/Linux developer who occasionally builds for OS X - particularly in Qt.

我是一名 Windows/Linux 开发人员,偶尔会为 OS X 构建 - 特别是在 Qt 中。

I have a simple Qt project that I have been developing on Windows. I now wish to build it on OS X.

我有一个在 Windows 上开发的简单 Qt 项目。我现在希望在 OS X 上构建它。

I am running Yosemite. I have installed Xcode 7 and am attempting to install Qt 5.5.

我正在运行优胜美地。我已经安装了 Xcode 7 并且正在尝试安装 Qt 5.5。

When I run the Qt installer, immediately after the prompt to log in to Qt (which is successful), I receive the following error:

当我运行 Qt 安装程序时,在提示登录 Qt(成功)后立即收到以下错误:

You need to install Xcode version 5.0.0.

您需要安装 Xcode 5.0.0 版。

Qt installation fails

Qt安装失败

I have attempted to locate Xcode 5.0.0 on the Apple Developer site, but this is 2 major versions behind the most recent version, and I cannot even find an installer for it.

我试图在 Apple Developer 网站上找到 Xcode 5.0.0,但这是最新版本的两个主要版本,我什至找不到它的安装程序。

More to the point, I do wonder why the most recent version of Qt requires a version of Xcode that is considered so old by Apple that it's not even available.

更重要的是,我确实想知道为什么最新版本的 Qt 需要一个被 Apple 认为过时的 Xcode 版本,以至于它甚至不可用。

How do I overcome this problem so that I can get Qt installed on OS X?

如何克服这个问题,以便在 OS X 上安装 Qt?

回答by gus

I ran into the same problem and solved it by following the instructions here. This link describes a similar, but slightly different installer issue.

我遇到了同样的问题并按照此处的说明解决了它。此链接描述了一个类似但略有不同的安装程序问题。

To summarize, you need to ensure that the Xcode command line tools are installed and set up correctly. I already had them installed, but had to go into Preferences -> Locationsin Xcode and set the dropdown to the currently installed version.

总而言之,您需要确保 Xcode 命令行工具已正确安装和设置。我已经安装了它们,但必须进入Preferences -> LocationsXcode 并将下拉列表设置为当前安装的版本。

The link shows an earlier version of Xcode where the path is actually Preferences -> Downloads -> Components.

该链接显示了 Xcode 的早期版本,其中的路径实际上是Preferences -> Downloads -> Components.

Once I'd made this change, the installer continued successfully.

一旦我进行了此更改,安装程序就会成功继续。

回答by Francesco Boi

The solution that worked for me (on OSX Sierra XCode 8.2.1) is to open XCode Preferences-> Locations.

对我有用的解决方案(在 OSX Sierra XCode 8.2.1 上)是打开 XCode Preferences-> Locations

There is a drop-down menu named Command Line Tools. Select the available XCode version here. Then restart the Qt Creator installation.

有一个名为 的下拉菜单Command Line Tools。在此处选择可用的 XCode 版本。然后重新启动 Qt Creator 安装。

回答by TSga

taken from the link above, this resolved my issue:

从上面的链接中获取,这解决了我的问题:

sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer 

回答by user11074957

For me closing the prompt and smashing keys (alt F4, I know that its not windows) before the next prompt opened worked... qt is running fine now, as it doesn't need the old version.

对我来说,在下一个提示打开之前关闭提示和粉碎键(alt F4,我知道它不是窗口)工作...... qt 现在运行良好,因为它不需要旧版本。

回答by SarahB

you can find the old version of XCode on the the Apple offical site hereand download .dmg of xcode 5 or 6.1 for example :

您可以在此处的 Apple 官方网站上找到旧版本的 XCode,并下载 xcode 5 或 6.1 的 .dmg 例如:

I do this and it's ok for me.

我这样做,对我来说没问题。