如何在不包含 Mac OS X 10.6 SDK 的 Xcode 版本中构建它

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9621859/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 23:34:10  来源:igfitidea点击:

How to build for Mac OS X 10.6 SDK in Xcode versions that don't include it

xcodecocoasdkbuildopenframeworks

提问by Dimitris

My Xcode only allows me to select Mac OS X 10.7 as the earliest Base SDK. Is it possible to install additional base SDKs?

我的 Xcode 只允许我选择 Mac OS X 10.7 作为最早的 Base SDK。是否可以安装额外的基础 SDK?

回答by bakercp

I found an old version of Xcode 4.3 on one of my backup disks and dragged a copy of:

我在我的一个备份磁盘上找到了一个旧版本的 Xcode 4.3 并拖动了一个副本:

/Developer/SDKs/MacOSX10.6.sdk

to:

到:

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

It now sits along side the MacOSX10.7.sdkand MacOSX10.8.sdk, which were already there. They came with Xcode 4.4.

现在沿侧坐MacOSX10.7.sdkMacOSX10.8.sdk,这是已经存在。它们随 Xcode 4.4 一起提供。

I'm running Xcode Version 4.4 (4F250) and OS X 10.8.

我正在运行 Xcode 版本 4.4 (4F250) 和 OS X 10.8。

After restarting Xcode, remember to go into build settings and set the Base SDK to OS X 10.6 if it defaulted to "Current OS X" and your project requires the 10.6 sdk.

重新启动 Xcode 后,请记住进入构建设置并将 Base SDK 设置为 OS X 10.6,如​​果它默认为“Current OS X”并且您的项目需要 10.6 sdk。

回答by Mark Szymczyk

Is there a reason you need the 10.6 SDK? If you set the deployment target to 10.6, you can use the 10.7 SDK and your app will run on 10.6, assuming you're not using anything added in 10.7.

您是否有需要 10.6 SDK 的原因?如果您将部署目标设置为 10.6,则可以使用 10.7 SDK,并且您的应用程序将在 10.6 上运行,假设您没有使用 10.7 中添加的任何内容。