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

前端 未结 10 2057
难免孤独
难免孤独 2020-11-28 08:47

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: Coul

相关标签:
10条回答
  • 2020-11-28 09:00

    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.

    0 讨论(0)
  • 2020-11-28 09:01

    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

    0 讨论(0)
  • 2020-11-28 09:02

    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
    0 讨论(0)
  • 2020-11-28 09:06

    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.

    0 讨论(0)
  • 2020-11-28 09:14

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

    0 讨论(0)
  • 2020-11-28 09:17

    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
    0 讨论(0)
提交回复
热议问题