Sebastian A
Sebastian A

Reputation: 521

Error: Could not resolve SDK path for 'macosx10.8'

So I just installed qt around 5 minutes ago, and when I wanted to code a simple line of text in the Push Button and try to run it, I got this error:

:-1: error: Could not resolve SDK path for 'macosx10.8'

Upvotes: 38

Views: 29257

Answers (10)

Willem van Ketwich
Willem van Ketwich

Reputation: 5984

All I had to do was accept the Xcode licence by running: sudo xcodebuild -license accept

Upvotes: 0

samprat
samprat

Reputation: 2214

In my case , I have just opened xcode again. It start installing some components. Once it finished , I open Qt again and everything start working fine.

Upvotes: 0

timpwbaker
timpwbaker

Reputation: 126

Coming to this late.

I had this error an all I needed to do was open up the actual Xcode app (which for some reason was not findable by spotlight but was in the applications folder), accept some terms, and let it do some config.

Upvotes: 3

L.Clague
L.Clague

Reputation: 31

I recently upgraded from OSX 10.8 to 10.12 and ran into this using Qt 5.7

The issue was resolved by a combination of:

1) FranklinA's suggestion:

Open Xcode->Preferences->Locations->command line tools..select the CLT xcode-select active developer directory error

..and..

2) adding to the .pro file the following line: QMAKE_MAC_SDK = macosx10.12

Upvotes: 3

rsp1984
rsp1984

Reputation: 1947

I'm running Qt 5.7.1 on Mac OS 10.12.2.

None of the above answers involving adding !host_build:QMAKE_MAC_SDK = macosx10.12 to a file worked for me.

What did work was a small reconfigure on the XCode side of things as described here, the key step being entering

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

in the command line.

What caused the problem for me was that I installed the XCode command line tools before installing XCode itself which apparently makes it hard for Qt to find the Mac OS SDK.

Upvotes: 52

Dylan_Larkin
Dylan_Larkin

Reputation: 513

add

QMAKE_MAC_SDK = macosx10.12

to your .pro file. Done and Done. (for some, qdevice.pri does not contain the !host_build line, and adding it does nothing, so just set the variable directly in the .pro file).

I have confirmed that you will eventually also have to implement this https://github.com/Homebrew/formula-patches/blob/master/qt5/xcrun-xcode-8.patch: which is just a matter of changing one line in your default_pre.prf file (for your appropriate machine aka Mac/PC, etc...)

Upvotes: 4

ALoopingIcon
ALoopingIcon

Reputation: 2348

Using QT 5.7.0, Mac OSX Sierra (10.12), XCode 8.0, I got the typical error coming from searching in:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk

instead of:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk

Adding the line

!host_build:QMAKE_MAC_SDK = macosx10.12

to the Qt/5.7/clang_64/mkspecs/qdevice.pri file, worked for me.

Upvotes: 1

Fabio De Carli
Fabio De Carli

Reputation: 379

For Qt 5.7 and macOS Sierra

Navigate to where you installed Qt (default /Users/your username/Qt) using finder

Go to the subdirectory 5.7/clang_64/mkspecs directory

Open the file called qdevice.pri with a text editor

Add line on end file

!host_build:QMAKE_MAC_SDK = macosx10.12

Upvotes: 3

Filip Pokorny
Filip Pokorny

Reputation: 41

In QT 5.7.0, Xcode 8.0 (8A218a), Mac OSX El Capitan (10.11.6), this issue happened from sudden in already configured environment. 5.7/clang_64/mkspecs/qdevice.pri no longer contains QMAKE_MAC_SDK line to modify.

I suspect some XCode part got silent update and I issue appeared again. This worked:

  1. open XCode and let it reconfigure again (automatic action upon start)
  2. delete .pro.user file from the project
  3. reopen project in QT

Upvotes: 1

docsteer
docsteer

Reputation: 2516

The problem is that the online installer for Qt currently supports OSX 10.8 (Mountain Lion) by default, and I'm guessing you are on 10.9 (Mavericks) or greater.

There is a workaround:

  • Navigate to where you installed Qt (default /Users/your username/Qt) using finder
  • Go to the subdirectory 5.3/clang_64/mkspecs directory
  • Open the file called qdevice.pri with a text editor
  • Change the line !host_build:QMAKE_MAC_SDK = macosx10.8 to:
    • !host_build:QMAKE_MAC_SDK = macosx10.9 if you are on OS X 10.9 (Mavericks), or
    • !host_build:QMAKE_MAC_SDK = macosx if you are on OS X 10.10 (Yosemite)
  • Save the file and restart Qt Creator

Upvotes: 76

Related Questions