40

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

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

I am running Yosemite. I have installed Xcode 7 and am attempting to install 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:

You need to install Xcode version 5.0.0.

Qt installation fails

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.

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.

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
Dan Nissenbaum
  • 13,558
  • 21
  • 105
  • 181
  • I doubt it will solve your problem, but XCode 5.0.0 appears to be available here under "XCode 5": https://developer.apple.com/downloads/ – Alexander O'Mara Jul 22 '15 at 05:02
  • @AlexanderO'Mara - Not sure how I missed that download. In any case - it did solve the issue. I guess the Qt OS X installer isn't exactly vetted. Thanks! – Dan Nissenbaum Jul 22 '15 at 05:33
  • Could you please also set the question as as solved – Marco Jul 22 '15 at 08:15
  • @Marco I am leaving this question open because - although I have installed Qt on OS X - I think an answer that incorporates an explanation or context regarding why the old Xcode 5 is required would be better than merely a link to it. But, in a few days, if nobody has anything insightful to incorporate into an answer, I will answer it myself and mark it as accepted. – Dan Nissenbaum Jul 22 '15 at 13:16
  • This is a Qt installer bug. Qt itself doesn't need the outdated xcode, and won't use it IIRC. Please report it as such, answer your own question stating that it is a Qt bug, with link to the bug report. – Kuba hasn't forgotten Monica Jul 22 '15 at 22:42
  • Looking forward to an answer to this question, as I too experienced this odd requirement. – johnbakers Oct 07 '15 at 11:34

6 Answers6

77

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 -> Locations in Xcode and set the dropdown to the currently installed version.

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

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

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
gus
  • 961
  • 6
  • 4
26

The solution that worked for me (on OSX Sierra XCode 8.2.1) is to open 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.

roschach
  • 8,390
  • 14
  • 74
  • 124
  • This worked perfectly on MacOS 10.13.3 when trying to run the maintenance tool to update from Qt 5.10.0 to Qt 5.10.1. Thanks! – Andrew Mar 02 '18 at 09:33
  • thanx for the method. If QT already installed, after adding location of Command Line Tools, just remove from ~/.config/ QtProject folder :) – Konstantin Streletsky May 24 '18 at 12:55
  • Works for me :) But why doesn't QT mention this as a suggested troubleshooting thing!?!? It just said "Xcode and developer command line tools don't exist" and I was like 'err, yeah they do, what you on about?'. – Gregory Fenn Feb 10 '19 at 12:31
12

taken from the link above, this resolved my issue:

sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer 
slfan
  • 8,950
  • 115
  • 65
  • 78
TSga
  • 191
  • 1
  • 8
  • That doesn't work. I got the error `xcode-select: error: invalid developer directory '/Applications/Xcode.app/Contents/Developer'`. – Donald Duck May 09 '17 at 16:36
  • What version of OS X are you running, and how was X Code installed? I just tried this again on 10.11.6 with X Code 8.1 and it works still. Take a look at this, might be related to how X Code was installed: http://stackoverflow.com/questions/17980759/xcode-select-active-developer-directory-error If you've used Homebrew there may be a few additional steps, something like this might help: https://apple.stackexchange.com/questions/209624/how-to-fix-homebrew-error-invalid-active-developer-path-after-upgrade-to-os-x – TSga May 10 '17 at 19:08
  • This solved the problem for me with Xcode 8.2.1 on Mac OS 10.11.6 trying to install Qt 5.9.1 – Jan Deinhard Sep 16 '17 at 13:00
1

It also might be related to accepting license agreements.

I faced the same issue described, despite I already had Xcode installed, Command Line Tools installed, and had already made sure XCode active developer folder was selected by making a xcode-select -s /Applications/Xcode.app.

Following the instructions in @gus answer, I launched Xcode to check if the command line tools was really installed and properly selected. It asked for license agreements. Going to Preferences -> Locations as suggested, I found that everything was OK.

Relaunching Qt installation after exiting Xcode, it was now working. So maybe performing a sudo xcodebuild -license accept could also help (or launch XCode at least once like I did and accept agreements when prompted).

Note that on XCode 14.3.1, Ventura (macOS 13), described option is located in XCode -> Settings -> Locations

Issue faced using qt-unified-macOS-x64-4.6.0-online dmg

Saitama
  • 103
  • 1
  • 9
0

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.

-2

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

I do this and it's ok for me.

SarahB
  • 135
  • 1
  • 11