如何强制 Xcode 链接到系统框架的自定义版本?
我有一个使用 OpenAL 的项目。该项目是针对10.5 SDK构建的,10.5中的OpenAL.framework版本导致了一些问题。我想链接到位于我的源代码树中的 OpenAL.framework 的定制版本。
然而,Xcode坚决拒绝这样做。无论我尝试什么,它都坚持链接到位于 /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL 的框架。以下是我尝试过但没有成功的一些方法:
- 使用 -F 以多种方式(相对、绝对)设置框架目录的路径。
- 向链接器传递 -Z 标志以消除默认链接路径,然后在链接过程中进一步显式传递 /System/Library,以确保它在我的自定义库路径之后看到系统路径。
- 使用预链接传递构建我的库,并将框架内的库显式传递给该库。
根据 man gcc 的说法,传递 -F 参数应该足以确保在默认路径之前搜索链接路径。这要么没有正确发生,要么我误解了这个问题,而且它看起来太简单和明显,不可能是链接器问题:-)
I have a project that uses OpenAL. The project is built against the 10.5 SDK, and the version of the OpenAL.framework in 10.5 causes some problems. I want to link to a custom-built version of the OpenAL.framework that resides in my source tree.
However, Xcode resolutely refuses to do this. No matter what I try, it insists on linking to the framework located at /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL. Here are a couple of things I've tried without success:
- Set the path to the framework directory in a variety of ways (relative, absolute) using -F.
- Pass the linker the -Z flag to eliminate default link paths, then explicitly pass /System/Library further on in the link process, to ensure that it sees the system paths after my custom library path.
- Build my library using a prelinking pass, and explicitly pass the library inside the framework to THAT.
According to man gcc
, passing the -F parameter should be sufficient to ensure that a link path is searched before the default paths. Either this isn't happening correctly or I'm misunderstanding the problem, and it seems too simple and obvious to be a linker problem :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论