简体   繁体   中英

Xcode 9 macos deployment target (with c++) giving error

When I try building a make project (from a c++ repository) I get the following error in XCode 9 : "MacBook Pro runs macOS 10.12.6, which is lower than program's minimum deployment target. Change your project's minimum deployment target or upgrade MacBook Pro's version of macOS."

I tried setting MAC_OS_DEPLOYMENT_TARGET and MAC_OSX_DEPLOYMENT_TARGET to no avail.

I really would appreciate any help as I'm banging my head against the wall trying to figure this out. It worked in XCode 8 as far as I remember.

Had the same exact issue when wanted to build open source C++ project which uses makefiles, hence used External Build System in Xcode 9.2.

Followed advice from QuinceyMorris (from here: https://forums.developer.apple.com/thread/96361 )

If you want to run the EBS target, you have to find an external way of providing the command-line arguments you need. In my case I added additional arguments to External Build Tool Configuration Arguments field CFLAGS=-mmacosx-version-min=10.12 CXXFLAGS=-mmacosx-version-min=10.12 . See screenshot attached.

Also check out this SO answer: C++, Mac OS X, Xcode 8 : Compile Boost : Set deployment target to OS X 10.11

在此处输入图片说明

Providing command Line arguments to the External Build Tool Configuration Arguments field did not work for me. (It's also worth noting that if you disable "Debug executable" while editing the target's scheme, it works - but I'm assuming that that is not something anyone wants). What eventually worked for me was just upgrading to High Sierra (10.13.4). It now builds in Release and Debug mode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM