Tommy Muir
Tommy Muir

Reputation: 61

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

I'm developing a macOS IOKit kernel driver extending from IOHIDFamily, but xcode is giving me linking errors such as:

Allocating an object of abstract class type 'IOHIDDevice'

and kextload gives me the error:

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

How can I properly link against IOHIDFamily to fix these errors so I can create classes inheriting from IOHIDFamily classes such as IOHIDDevice?

I have already added this to my 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>

These are the system/kernel logs from 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.

Any help would be greatly appreciated.

Upvotes: 1

Views: 937

Answers (1)

Tommy Muir
Tommy Muir

Reputation: 61

Turns out the issue wasn't related to linking at all. I wasn't defining the pure virtual method newReportDescriptor on my subclass of IOHIDDevice, which made my subclass into an abstract class which couldn't be allocated.

Upvotes: 1

Related Questions