无法 link IOKit 驱动程序针对 IOHIDFamily:"dependency load failed"

Unable to link IOKit driver against IOHIDFamily: "dependency load failed"

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

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).

我如何正确地 link 针对 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 的 system/kernel 日志:

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.

如有任何帮助,我们将不胜感激。

原来这个问题与链接根本无关。我没有在 IOHIDDevice 的 subclass 上定义纯虚方法 newReportDescriptor,这使我的 subclass 变成了无法分配的抽象 class。