1

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?

4

2 に答える 2

1

IOKit.framework にリンクする必要があると思います

于 2011-10-06T22:54:21.267 に答える
0

なぜ重要なのかよくわかりませんが、静的関数内で I/O キットの関数を呼び出しても、コンパイラは問題を報告しませんが、静的関数を使用しないとエラーが発生します。

于 2011-10-07T05:47:39.360 に答える