当 XCode 安装在替代目录中时,如何在 OS X 上正确包含头文件?

发布于 2024-11-26 15:07:54 字数 228 浏览 2 评论 0原文

我有一些项目无法构建,因为标头包含没有。

这是由于使用 $(SDKROOT)/Developer/Headers/FlatCarbon 引起的,但在我的系统上 Xcode 安装在另一个目录中。

我还尝试了 SDK_DIR 但没有成功,并且我无法在 Apple 文档中找到有关这些的信息。

如何正确配置项目以便独立于 Xcode 位置进行构建?

I have some projects that are failing to build because the header inclusion does not.

This is caused by the usage of $(SDKROOT)/Developer/Headers/FlatCarbon, but on my system Xcode was installed in another directory.

I also tried SDK_DIR without success and I was not able to locate information about these on Apple documentation.

How can I properly configure the project in order to be build independent of Xcode location?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你与清晨阳光 2024-12-03 15:07:54

这不是对您问题的直接答案,但快速解决方案是建立从 /Developer 到您的 XCode 安装目录的符号链接。

It's not a direct answer to your question, but a quick solution would be to make a symbolic link from /Developer to your XCode installation directory.

热鲨 2024-12-03 15:07:54

我从 Apple 论坛得到了正确的答案,使用 $(SYSTEM_DEVELOPER_DIR)

I got the proper answer from Apple forums, use $(SYSTEM_DEVELOPER_DIR).

巾帼英雄 2024-12-03 15:07:54

我在每个新版本的 XCode 中使用此脚本来建立到旧 SDK 的链接。它依赖于我保存在单独卷上的 XCode 4.2 副本,但它真正需要的是 SDK 文件夹。添加 PPC 支持需要一些额外的工作和 XCode 3,但还有其他涵盖该主题的很好的答案。

#!/bin/bash

#
# Add older SDKs to the latest XCode
# TODO: Add older architecture, PPC
#

#### CHANGE THESE TO YOUR OWN PATHS ####
XCODE=/Applications/Xcode.app
XPLAT=$XCODE/Contents/Developer/Platforms
SRCDEV=/Volumes/Dev/Developer
SRCIOS=$SRCDEV/Platforms/iPhoneOS.platform/Developer/SDKs

#
# Add 10.6 and 10.7 support
#
cd $XPLAT/MacOSX.platform/Developer/SDKs
sudo ln -s $SRCDEV/SDKs/MacOSX10.6.sdk MacOSX10.6.sdk
sudo ln -s $SRCDEV/SDKs/MacOSX10.7.sdk MacOSX10.7.sdk

#
# Add iOS 5.0 and 6.1 support
#
cd $XPLAT/iPhoneOS.platform/Developer/SDKs
sudo ln -s $SRCIOS/iPhoneOS5.0.sdk iPhoneOS5.0.sdk
sudo ln -s $SRCIOS/iPhoneOS6.1.sdk iPhoneOS6.1.sdk

#
# Add 10.5 and PPC support
#

#  --- not currently implemented ---

I use this script with each new version of XCode to establish links to older SDKs. It relies on a copy of XCode 4.2 that I keep on a separate volume, but all it really needs is the SDKs folders. To add PPC support requires some extra work and XCode 3, but there are other good answers covering that subject.

#!/bin/bash

#
# Add older SDKs to the latest XCode
# TODO: Add older architecture, PPC
#

#### CHANGE THESE TO YOUR OWN PATHS ####
XCODE=/Applications/Xcode.app
XPLAT=$XCODE/Contents/Developer/Platforms
SRCDEV=/Volumes/Dev/Developer
SRCIOS=$SRCDEV/Platforms/iPhoneOS.platform/Developer/SDKs

#
# Add 10.6 and 10.7 support
#
cd $XPLAT/MacOSX.platform/Developer/SDKs
sudo ln -s $SRCDEV/SDKs/MacOSX10.6.sdk MacOSX10.6.sdk
sudo ln -s $SRCDEV/SDKs/MacOSX10.7.sdk MacOSX10.7.sdk

#
# Add iOS 5.0 and 6.1 support
#
cd $XPLAT/iPhoneOS.platform/Developer/SDKs
sudo ln -s $SRCIOS/iPhoneOS5.0.sdk iPhoneOS5.0.sdk
sudo ln -s $SRCIOS/iPhoneOS6.1.sdk iPhoneOS6.1.sdk

#
# Add 10.5 and PPC support
#

#  --- not currently implemented ---
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文