簡體   English   中英

無法將 IOKit 驅動程序鏈接到 IOHIDFamily:“依賴加載失敗”

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

我正在開發一個從 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.

任何幫助將不勝感激。

原來這個問題根本與鏈接無關。 我沒有在newReportDescriptor子類上定義純虛方法newReportDescriptor ,這使我的子類變成了無法分配的抽象類。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM