如何在 Xcode 6 中获得 10.8 SDK 和 5.1 编译器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25914235/
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-15 05:36:33  来源:igfitidea点击:

How to get 10.8 SDK and 5.1 compiler in Xcode 6

xcodexcode6osx-mavericksllvm-clang

提问by Shalafi

as from the title, I need to use the 10.8 SDK and the 5.1 (or 5.0) LLVM compiler with Xcode 6, in Mavericks. With the previous Xcode, it was possible to have both the SDKs, but now I see only the 10.9 one. How can I install the previous SDK and compiler in Xcode 6?

正如标题所示,我需要在 Mavericks 中使用 10.8 SDK 和 5.1(或 5.0)LLVM 编译器和 Xcode 6。使用以前的 Xcode,可以同时拥有两个 SDK,但现在我只能看到 10.9 的一个。如何在 Xcode 6 中安装以前的 SDK 和编译器?

回答by byronc

It's probably not supported by Apple, but I've seen good results by copying the 10.8 SDK from the Xcode 5.1.1 DMG.

Apple 可能不支持它,但通过从 Xcode 5.1.1 DMG 复制 10.8 SDK,我看到了不错的结果。

sudo cp -a /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk \
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs

回答by Shalafi

I tried different ways, and it seems that both @trojanfoe and @byronc are right. On the one hand, by targeting 10.8 with the 10.9 SDK, all the compiling stuff ends fine, so it seems to me the most correct way, using "official" Apple stuff. On the other, when I tried to copy and paste the 10.8 SDK from an old Xcode 5 installation to the Xcode 6 correct folder, the SDK showed up in my project, so this way seems functional too, even if I think it is not the most clear way.

我尝试了不同的方法,似乎@trojanfoe 和@byronc 都是对的。一方面,通过将 10.9 SDK 定位到 10.8,所有编译的东西都结束了,所以在我看来,使用“官方”Apple 的东西是最正确的方法。另一方面,当我尝试将 10.8 SDK 从旧的 Xcode 5 安装复制并粘贴到 Xcode 6 正确文件夹时,SDK 出现在我的项目中,所以这种方式似乎也有用,即使我认为它不是最清楚的方式。