无法将IOKit驱动程序与IOHIDFamily链接:“依赖项加载失败”

时间:2019-08-10 15:13:29

标签: c++ macos kernel driver iokit

我正在开发从IOHIDFamily扩展的macOS IOKit内核驱动程序,但是xcode却给了我链接错误,例如:

Allocating an object of abstract class type 'IOHIDDevice'

和kextload给我错误:

(libkern/kext) dependency load failed; check the system/kernel logs for errors or try kextutil(8).

如何正确链接到IOHIDFamily以修复这些错误,以便可以创建从IOHIDFamily类(例如IOHIDDevice)继承的类?

我已经将它添加到我的Info.plist中:

    <key>OSBundleLibraries</key>
    <dict>
        <key>com.apple.iokit.IOHIDFamily</key>
        <string>2.0</string>
        <key>com.apple.kpi.iokit</key>
        <string>17.7</string>
        <key>com.apple.kpi.libkern</key>
        <string>17.7</string>
        <key>com.apple.kpi.mach</key>
        <string>17.7</string>
    </dict>

这些是来自kextload的系统/内核日志:

Resetting IOCatalogue.
MacOS error: -67062
Kext with invalid signatured (-67062) allowed: <OSKext 0x7f99b7bf47c0 [0x7fff83ef4af0]> { URL = "file:///tmp/IOHIDTest.kext/", ID = "org.muirey03.driver.IOHIDTest" }
/tmp/IOHIDTest.kext is invalid; can't resolve dependencies.
org.muirey03.driver.IOHIDTest's dependencies failed security checks; failing.

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

事实证明,该问题根本与链接无关。我没有在IOHIDDevice的子类上定义纯虚拟方法newReportDescriptor,这使我的子类成为了无法分配的抽象类。