[SOLVED] XCode 7 and Qt error



  • Hi Guys... tonight I had upgrade my XCode to the new version (version 7), before that everything was perfect, now i got this error:

    clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'
    clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'
    In file included from ../../anclan_kernel/common/Common.cpp:1:
    In file included from ../../anclan_kernel/common/Common.h:4:
    In file included from ../../anclan_kernel/common/common_global.h:4:
    In file included from /Applications/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qglobal.h:39:
    In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef:36:
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:23:10: fatal error: 'unistd.h' file not found
    #include <unistd.h>
    ^
    In file included from ../../anclan_kernel/common/common_definitions.cpp:1:
    In file included from ../../anclan_kernel/common/common_definitions.h:4:
    In file included from /Applications/Qt/5.5/clang_64/lib/QtCore.framework/Headers/QStringBuilder:1:
    In file included from /Applications/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstringbuilder.h:44:
    In file included from /Applications/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:41:
    In file included from /Applications/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qchar.h:37:
    In file included from /Applications/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qglobal.h:39:
    In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef:36:
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:23:10: fatal error: 'unistd.h' file not found
    #include <unistd.h>
    ^
    In file included from ../../anclan_kernel/common/Utils.cpp:1:
    In file included from ../../anclan_kernel/common/Utils.h:4:
    In file included from /Applications/Qt/5.5/clang_64/lib/QtCore.framework/Headers/QtGlobal:1:
    In file included from /Applications/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qglobal.h:39:
    In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef:36:
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:23:10: fatal error: 'unistd.h' file not found
    #include <unistd.h>
    ^
    1 error generated.
    make[1]: *** [Common.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    1 error generated.
    make[1]: *** [common_definitions.o] Error 1
    1 error generated.
    make[1]: *** [Utils.o] Error 1
    make: *** [sub-common-make_first-ordered] Error 2
    01:09:34: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project anclan_kernel (kit: Desktop Qt 5.5.0 clang 64bit)
    When executing step "Make"

    does anyone know about it ?? because I didn't have this error before upgrade

    regards



  • @freddy311082 Friend, just add to the .PRO file in the Project dir:

    QMAKE_MAC_SDK = macosx10.11

    QT is trying to use the SDK Version 10.10, but Xcode 7 has the 10.11 version.
    Every time you get this error, do "ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/" in Terminal and change the QMAKE_MAC_SDK variable accordingly.



  • nicely done @Leandro, that does it. Cheers!



  • @Leandro
    Well done bro !!! it's work

    thanks.... :)



  • @Leandro said:

    ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/

    Great idea! However, I am now stuck with this error:
    :-1: error: Current macosx10.11 SDK version (10.11) is too old. Please upgrade Xcode.

    I am surprised because by Xcode is Version 7.0 (7A220)



  • @Hercule I'm having the same problem when building for iOS. It solves the problem for building a Mac app, but sadly not for building iOS apps. Does anyone have a solution for that?



  • It seems that when the Xcode update is applied the ios build tools are no longer loaded for creator to use this seems a bigger issue then just setting the SDK version



  • @wozza Just looking at this and then adding the iphone simulator kit it complains :-1: error: Current macosx10.11 SDK version (10.11) is too old. Please upgrade Xcode. Now if you do ls /Applications/Xcode.app/Contents/Developer/Platforms/ on the terminal you will find multiple sdk kits so how do we then add these kits to the .pro file to support the platform we want to publish too?



  • @Hercule it seems that if we do QMAKE_MAC_SDK = iphoneos you can then deploy to the iphone



  • @wozza But if i do QMAKE_MAC_SDK = iphoneos, the old problem with

    0: fatal error: 'unistd.h' file not found
    #include <unistd.h>

    appears again.



  • @wozza Found the solution by myself by setting only the version for macosx to 10.11:

    QMAKE_MAC_SDK.macosx.version = 10.11


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.