Important: Please read the Qt Code of Conduct -

Made the mistake of updating Xcode

  • I made the mistake of updating XCode today. (I knew better, but I selected "Update All".)

    As a result, I am receiving a error "TargetConditionals.h file not found" when I compile my application.

    From previous experience, I know that I need to update the .pro file with "QMAKE_MAC_SDK = macosx10.13". However, that is not resolving the problem. Has anyone sound a solution to this issue?


  • its not need after xcode7 to write sdk version.. ***
    cd /Applications/
    open ./

    QMAKE_MAC_SDK is old..
    in time wo you compile you see min. 10.11 or 10.. but sierra can use...


  • Patrik,

    I added "QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13" to my .pro file and I still receive the same error.


  • I just had the same problem. Clean build did not help, had to do complete wipe = delete the build directory and then rebuild get rid of this error.

  • I just deleted my build directory and I still have the error when I recompile. I also tried to compile an example project and have the same error.


  • I just reverted back to an older version of Xcode. This solved my problem. Not a very good solution, but I am up and running again.


  • Same problem here. Tried grepping the whole /opt/Qt/5.9 hierarchy against MacOSX10.12 but nothing. The -spec is macosx and ../mkspec hierarchy seems to set things right.
    I solved this by adding a symbolic link macosx10.12 -> macosx
    (Sorry I don't remember the actual file- and directorynames as I do not have my mac on hand)

    Can someone point me to from where the MacOSX10.12 comes from -- apparently runtime detected

  • Moderators

    Have a look at the comments of this ticket:

    I think it'd help.

  • Adding this line :
    QMAKE_MAC_SDK = macosx10.13
    in the qdevice.pri file (/clang_64/mkspecs of QT).

  • Hello, just had exactly the same problem. What worked for me was to delete all the build directory and recompile everything.

    Hope this helps others.

  • Found the following with Qt5.9.1 on OS X 10.11.6: QMAKE_MAC_SDK is only useful für 32bit builds; when building for 64bit instead add to the pro file:
    INCLUDEPATH += /usr/include
    QMAKE_LFLAGS += -F/System/Library/Frameworks -L/usr/lib
    The first line is necessary because of TargetConditionals.h.
    The second line is necessary because of DiskArbitration framework and c++ library not found. After these tricks the 64bit application compiles and runs.

  • This bug report indeed was helpful:

    Specifically, Thiago indicated to:

    • Remove .qmake.cache, .qmake.stash and all other cache files and then try again, starting from configure.
    • If you updated Xcode, then the path to the headers changed and qmake needs to know to search again for them.

    In other words, "Clean Project" or "Rebuild Project" is not enough. You need to either delete every single (hidden) file from the build directories or more easily just trash the build directories and then rebuild.

    You'll then get the key message:
    Info: creating stash file /Users/XXX/Qtprojects/build-TestCompileErrors-Desktop_Qt_5_11_1_clang_64bit-Debug/.qmake.stash

    And your project will run!

Log in to reply