Mac OS X Lion 和 Xcode 升级:缺少标头和库

发布于 2024-11-26 02:44:26 字数 298 浏览 2 评论 0原文

升级到 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 技术交流群。

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

发布评论

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

评论(4

月牙弯弯 2024-12-03 02:44:26

从 App Store 下载 Xcode 4 后,尝试运行“/Applications/Install Xcode.app”。

After downloading Xcode 4 from the App Store, try running "/Applications/Install Xcode.app".

隐诗 2024-12-03 02:44:26

对我来说,只需下载 Xcode 命令行工具就可以了。 (当然,为此,我首先要安装 Xcode 本身,我是通过 App Store 安装的。

  1. 启动 Xcode
  2. 打开 Xcode→Preferences...
  3. 选择 下载选项卡
  4. 安装命令行工具

安装一些软件包,请参阅/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.

  1. Start Xcode
  2. Open Xcode→Preferences...
  3. Select the Downloads tab
  4. Install the Command line tools

That installs a few packages, see /var/db/receipts. The package that contains /usr/include is com.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.

锦上情书 2024-12-03 02:44:26

要让 Xcode 填充 /usr/include 目录,请运行以下命令:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

您可能需要在 Xcode 中安装 Xcode 命令行工具才能正常工作。打开“首选项”菜单,然后在“下载”下安装命令行工具。

To get Xcode to populate the /usr/include directory, run the following command:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

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.

原来是傀儡 2024-12-03 02:44:26

njamesp 的上述答案还解决了以下错误:

configure: error: C compiler cannot create executables

在从 10.5 时间机器设置后尝试在 10.7 系统上编译代码时,我收到此错误,因此我假设我的系统上安装了错误版本的 xcode。

The above answer by njamesp also addresses the following error:

configure: error: C compiler cannot create executables

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.

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