我正在开发一个从 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.
如有任何帮助,我们将不胜感激。
最佳答案
原来这个问题根本与链接无关。我没有在我的 IOHIDDevice 子类上定义纯虚方法 newReportDescriptor
,这使我的子类成为无法分配的抽象类。
关于c++ - 无法将 IOKit 驱动程序链接到 IOHIDFamily : "dependency load failed",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57443341/