LoginSignup
2
1

More than 5 years have passed since last update.

Mac OS X 10.12 (Sierra) + Qt 5.8 の環境下でプログラムのビルド時に TargetConditionals.h がないと怒られる

Last updated at Posted at 2017-03-12

エラーメッセージ

/Users/XXXX/Qt/5.8/clang_64/lib/QtCore.framework/Headers/qsystemdetection.h:95:12: fatal error: 'TargetConditionals.h' file not found

原因
MacのSDKのバージョンが10.12よりも古いものが指定されている

解決手順

% cd ~/Qt/5.8/clang_64/mkspecs/features/mac
% cp sdk.prf sdk.prf_original  # 念のためバックアップ
% vi sdk.prf # 直接編集して次の変数をオーバーライトすればOK

QMAKE_MAC_SDK_PATH = $$system("xcodebuild -version -sdk | grep '^Path.*MacOSX' | cut -d ' ' -f 2")

(参考)system関数に渡した引数

% xcodebuild -version -sdk | grep '^Path.*MacOSX' | cut -d ' ' -f 2

# 出力
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk

環境
- OS X Sierra 10.12.3
- Qt 5.8.0 (インストーラ : qt-unified-mac-x64-2.0.5-online.app)

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1