Mac OS X Lion 和 Xcode 升级:缺少标头和库
升级到 Lion 并升级 Xcode 后,make 似乎无法找到标头和库。我查看了/usr/include。那里唯一的东西是“parallels-server”。因此,我将 /usr/include 重命名为 /usr/include.old,并创建了一个符号链接:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/
这非常邪恶。但是,make 现在可以找到标头。仍然无法找到库(例如lcrt1.10.6.o)。
解决 include 和 lib 问题的正确方法是什么?
谢谢!
After upgrading to Lion, and upgrading Xcode, make can't seem to locate headers and libs. I looked in /usr/include. The only thing in there was 'parallels-server'. So, I renamed /usr/include to /usr/include.old, and made a symlink to:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/
This is pretty evil. But, make can now find headers. Still can't locate libs (e.g., lcrt1.10.6.o).
What is the correct way to solve both the include and lib problems?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
从 App Store 下载 Xcode 4 后,尝试运行“/Applications/Install Xcode.app”。
After downloading Xcode 4 from the App Store, try running "/Applications/Install Xcode.app".
对我来说,只需下载 Xcode 命令行工具就可以了。 (当然,为此,我首先要安装 Xcode 本身,我是通过 App Store 安装的。
安装一些软件包,请参阅
/var/db/receipts
包含/usr/include 的软件包。
是com.apple.pkg.DevSDKLeo
我认为不需要
xcode-select
,但我在下载命令行工具之前已经运行了该命令,所以我不需要不确定。From me, just downloading the Xcode Command line tools did the trick. (For that, of course, I had first to install Xcode itself, which I installed trough App Store.
That installs a few packages, see
/var/db/receipts
. The package that contains/usr/include
iscom.apple.pkg.DevSDKLeo
.I don't think
xcode-select
is needed, but I had run that command before I downloaded the Command line tools, so I don't know for sure.要让 Xcode 填充 /usr/include 目录,请运行以下命令:
您可能需要在 Xcode 中安装 Xcode 命令行工具才能正常工作。打开“首选项”菜单,然后在“下载”下安装命令行工具。
To get Xcode to populate the /usr/include directory, run the following command:
You may need to install the Xcode Command Line Tools within Xcode for this to work. Open the Preferences menu, then under Downloads install Command Line Tools.
njamesp 的上述答案还解决了以下错误:
在从 10.5 时间机器设置后尝试在 10.7 系统上编译代码时,我收到此错误,因此我假设我的系统上安装了错误版本的 xcode。
The above answer by njamesp also addresses the following error:
I received this error when trying to compile code on my 10.7 system after setting it up from a 10.5 time machine, so I assume the wrong version of xcode was installed on my system.