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开发者_如何学JAVA, 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?
I would say you need to link to the IOKit.framework
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.
精彩评论