c++ - 无法将 IOKit 驱动程序链接到 IOHIDFamily : "dependency load failed"

标签 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.

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

最佳答案

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

关于c++ - 无法将 IOKit 驱动程序链接到 IOHIDFamily : "dependency load failed",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57443341/

相关文章:

macos - 在系统级别的 Mac OS X Lion 上修改传出的 HTTP header

macos - 调整所有正在运行的应用程序的所有窗口

在内核中调用 do_fork

r - 在 R 中叠加内核分布

c++ - 我可以从 Visual Studio 即时窗口调用 Win32 API 吗?

c++ - Qt:信号调用函数的默认参数

linux - 如何在 Linux/Mac/Windows 中模拟 Touch 事件?

Windows 内核级全局临界区

c++ - 将 QObject 用作​​类成员并将该成员用作连接的上下文是否安全?

c++ - 如何在另一个窗口中正确创建 CMFCListCtrl?