依赖库指向设备构建

发布于 2024-11-29 18:22:27 字数 442 浏览 2 评论 0原文

我有一个 XCode 4 项目,其中有一个附加的依赖项项目。依赖项目创建了主要项目所需的静态库。

我正在尝试从“目标”->“构建阶段”->“将二进制与库链接”添加库,并在工作区中选择静态库。

问题是每次我这样做时,构建设置“库搜索路径”都会附加到 iphoneos 构建的构建路径。当我尝试为模拟器进行编译时,该文件被忽略,因为它不适用于 i386 架构,并且构建失败。

我一直在疯狂地寻找,不明白我在做什么不同的事情。在我看来,XCode 似乎应该发挥一些作用,将模拟器与模拟器、设备与设备链接起来——但对我来说,它总是添加设备或模拟器的特定路径。

(我尝试过使用两个目标来区分它们,这很有效,但这根本不是一个理想的解决方案。我每次都必须更改 2 个目标而不是 1 个。)

希望我能被理解,

pleeeaaaaase 帮助:)

Oded。

I've got an XCode 4 project that has an additional dependency project in it. The dependency project creates a static library I need for the major project.

I'm trying to add the library from the Target->Build Phases->Link Binary With Libraries, choosing the static library in my workspace.

Problem is every time I do that, the build settings "Library Search Paths" is appended a path to the build of the iphoneos build. When I try to compile for simulator, that file is ignored as it not meant for i386 architecture and the build fails.

I've been searching like mad, not understanding what I'm doing differently. Everywhere I look, it seems like XCode should be doing some magic to link simulator with simulator and device with device - But for me it always adds the specific path to either the device or simulator.

(I've tried using two targets to differ them, and that worked, but it's not an ideal solution at all. I have to change 2 targets everytime instead of 1.)

Hope I was understood,

pleeeaaaaase help :)

Oded.

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

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

发布评论

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

评论(1

隔岸观火 2024-12-06 18:22:27

我的同事最终找到了答案 -

在 XCode 4 中,默认情况是将所有项目构建到共享构建文件夹中。我着迷于 XCode 3,将其切换到旧方法,其中构建文件夹位于项目文件夹中。

事实证明,将 XCode 切换到在一个唯一的位置进行构建,可以让奇迹发生,并且可以将相应的构建一起构建。有人告诉我这正是它的用途,但没有参考链接。

Xcode 菜单 ->首选项->地点 ->构建位置:
- 将构建放置在派生数据位置(推荐)
- 独特的子文件夹

干杯,
奥德.

My colleague found the answer eventually -

In XCode 4 the default is to build all projects to a shared building folder. Me being fixated with XCode 3, switched it to the old method in which the build folder is in your project folder.

Turns out switching XCode to build in a single unique place, allowed the magic to happen to and to the corresponding builds be built together. I've been told it's exactly what it's meant for, but have no link to the reference.

XCode Menu -> Preferences -> Locations -> Build Location:
- Place build in derived data location (recommended)
- Unique subfolder

Cheers,
Oded.

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