我刚刚更新了OS X Mavericks中命令行工具的最新版本,现在编译我的(之前正常工作的)代码时会抛出以下错误
> clang: warning: no such sysroot directory:
> '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk'
> In file included from ../QtOpenGL/Main.cpp:1: In file included from
> ../../Qt/5.3/clang_64/lib/QtWidgets.framework/Versions/5/Headers/QApplication:1:
> In file included from
> ../../Qt/5.3/clang_64/lib/QtWidgets.framework/Versions/5/Headers/qapplication.h:45:
> In file included from
> /Users/BB/Qt/5.3/clang_64/lib/QtCore.framework/Headers/qcoreapplication.h:45:
> In file included from
> /Users/BB/Qt/5.3/clang_64/lib/QtCore.framework/Headers/qglobal.h:76:
> /Users/BB/Qt/5.3/clang_64/lib/QtCore.framework/Headers/qsystemdetection.h:196:12:
> fatal error: 'TargetConditionals.h' file not found
> # include <TargetConditionals.h>
> ^ 1 error generated. make: *** [Main.o] Error 1 20:29:52: Le processus "/usr/bin/make" s'est terminé avec le code 2. Erreur lors
> de la compilation/déploiement du projet QtOpenGL (kit : Desktop Qt
> 5.3.0 clang 64bit) When executing step "Make"
有人知道如果更改这一行会发生什么吗?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
从SDK 8到9可以工作吗?如果可以,那么我应该在Qt5的参数中更改哪些内容?
QMAKE_MAC_SDK = macosx10.9
就足够解决问题了。请注意不要改变原文的意思,并使翻译通俗易懂。 - ALoopingIconQMAKE_MAC_SDK = macosx10.11
做同样的事情。 - Algebraic PavelQMAKE_MAC_SDK = macosx10.12
适用于macOS Sierra。 - AivanF.qt5/qtbase/mkspecs/qdevice.pri
,其中qt5
是 Git 根目录。 - Carson Ip