XCode:在 kext 中包含框架?

发布于 2024-12-18 00:51:54 字数 317 浏览 3 评论 0原文

我正在编写的内核扩展需要包含一个框架(DirectIO),因此我在目标属性的“链接库”部分中添加了该框架。然后我将其包含在主源文件中。

问题是,每当我尝试构建它时,它都会出现以下错误:

/Developer/usr/bin/ld_classic: incompatible flag -framework used (must specify "-dynamic" to be used)

我在 Snow Leopard 上使用 XCode 3.2,为 OSX i386 构建。是否可以在 .kext 目标中包含 .framework?

The kernel extension I am writing needs to include a framework (DirectIO), so I added the framework in the "Linked Libraries" section of the target properties. I then included it in the main source file.

The problem is, whenever I try to build it, it gives this error:

/Developer/usr/bin/ld_classic: incompatible flag -framework used (must specify "-dynamic" to be used)

I'm using XCode 3.2 on Snow Leopard, building for OSX i386. Is it possible to include a .framework in a .kext target?

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

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

发布评论

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

评论(1

淡淡绿茶香 2024-12-25 00:51:54

我认为在构建内核扩展时不能链接框架(Kernel.framework 除外)或动态库。

您的代码将在主管模式下运行。 LD相关的东西在那个阶段基本上是没有的。

但是,您可以使用 kext 的 plist 文件 (OSBundleLibraries) 链接到其他扩展 (/System/Library/Extensions)。

请参阅 内核扩展编程主题文档。

可用的内核扩展中有很多与 I/O 相关的内容。也许你会找到一个等价的。

I don't think you can link with a framework (other than Kernel.framework) or a dynamic library when building a kernel extension.

Your code will run in supervisor mode. LD related stuff is basically not available in that stage.

You may however link with other extensions (/System/Library/Extensions), using your kext's plist file (OSBundleLibraries).

See 'Determine Kext Dependencies' of the Kernel Extension Programming Topics documentation.

There's a lot of I/O related stuff in the available kernel extension. Maybe you'll find there an equivalent.

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