如何更正“架构 x86_64 的未定义符号” I/O Kit 出现问题?

发布于 2024-12-08 20:13:20 字数 390 浏览 6 评论 0原文

我正在运行 OSX Lion,并希望使用引用的 I/O Kit 注册睡眠通知 此处

当我编译代码时,我得到了以下符号的 Undefined Symbols for Architecture x86_64IOAllowPowerChangeIORegisterForSystemPowerIONotificationPortGetRunLoopSource

我查了苹果的文档,都是公共函数。关于我为什么会遇到这些问题有什么建议吗?

I am running OSX Lion and would like to register for sleep notifications using I/O Kit as referenced here.

When I compile the code, I get Undefined symbols for architecture x86_64 for the following symbols IOAllowPowerChange, IORegisterForSystemPower and IONotificationPortGetRunLoopSource.

I searched in Apple's documentation and they are all public functions. Any suggestions as to why I am getting those issues?

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

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

发布评论

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

评论(2

酷到爆炸 2024-12-15 20:13:20

我想说你需要链接到 IOKit.framework

I would say you need to link to the IOKit.framework

街角卖回忆 2024-12-15 20:13:20

我不太清楚为什么它很重要,但如果我在静态函数中调用任何 I/O 工具包的函数,编译器不会报告问题,但如果我不使用静态函数,则会收到错误。

I'm not too sure why it matters but if I call any of the I/O kit's functions within a static function, the compiler will not report a problem, but if I don't use a static function I get an error.

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