在OS X上安装Qt Creator

时间:2016-04-29 02:23:15

标签: macos qt clang

我正在尝试在OS X v10.11上安装Qt。我正在使用安装程序qt-unified-mac-x64-2.0.3-online。它现在显示一张表:

  

您需要安装Xcode 5.0.0版   从https://developer.apple.com/xcode

下载Xcode

尝试关闭工作表(按“确定”)会使其重新出现。

当前版本的Xcode是7.3。我可以说,它只能通过App Store获得,因此只能下载最新版本。

从6个月前开始,{p> This page声称不支持Xcode 7。但是,该页面引用this page作为源,该源页面仅表示需要Clang。 “Xcode”没有出现在页面上。

我有Clang:

$ which clang
/usr/bin/clang

$ clang -v
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

......但Qt在线安装程序不允许我继续使用。

为了让Qt Creator安装并运行,我需要在OS X上安装的最低软件是什么?

更新:我在按“OK”约4次后发布了此问题。在发布问题之后,我沮丧地再按了“OK”大约5次。最终,它消失了,并允许安装继续。 (!)

但是,当我尝试构建项目时,Qt Creator会抱怨“Xcode设置不正确。您可能需要运行/usr/bin/xcodebuild来确认许可协议。”

运行该命令显示:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer
directory '/Library/Developer/CommandLineTools' is a command line tools instance

所以看起来我确实需要Xcode。

1 个答案:

答案 0 :(得分:4)

我也有这个问题。我似乎也安装了XCode命令行工具,并且有一种方法可以在它们之间进行选择:

$ xcodebuild
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

$ xcode-select -p # Print currently selected xcode tools
/Library/Developer/CommandLineTools

$ sudo xcode-select -s /Applications/Xcode.app # Select the XCode app.

之后它起作用了。