Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt5 Target conditionals not found

I just updated to the latest version of command line tools in OS X Mavericks and now when compiling my (previously-working) code it throws the following error

> 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"

Does anyone knows that if changing this line

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

from sdk 8 to 9 would work? If so, where in the parameters of Qt5 can I change this?

like image 751
BRabbit27 Avatar asked Sep 19 '14 18:09

BRabbit27


4 Answers

For other people's reference, I solved the issue by editing my platform mkspec file:

/users/nic/Qt/5.3/clang_64/mkspecs/qdevice.pri

change the following line:

!host_build:QMAKE_MAC_SDK = macosx10.8

to this:

!host_build:QMAKE_MAC_SDK = macosx10.9

Be sure to clean your project and run qmake again.

Nic.

like image 113
Nicolas Christiaens Avatar answered Oct 22 '22 22:10

Nicolas Christiaens


It is possible to compile the project also by adding the following line to the .pro file

QMAKE_MAC_SDK = macosx10.9
like image 43
BRabbit27 Avatar answered Oct 22 '22 21:10

BRabbit27


If you compile in other platforms than OS X, an improvement of BRabbit27 solution would be:

macx {
QMAKE_MAC_SDK = macosx10.9
}
like image 10
asam Avatar answered Oct 22 '22 21:10

asam


I just upgraded to XCode 9 and I started getting this problem on macOS Sierra (10.12). The problem is that Xcode moved the default symlink to 10.13. To fix:

cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
sudo ln -s MacOSX.sdk MacOSX10.12.sdk
like image 10
Pablo Diaz Avatar answered Oct 22 '22 22:10

Pablo Diaz