Subclassing from IOUserUSBSerial

Hey!

I'am trying to write my own driver for usb serial device. I'am trying to subclass from IOUserUSBSerial


#include <DriverKit/IOService.iig>

#include <USBSerialDriverKit/IOUserUSBSerial.iig>



class NewDriver: public IOUserUSBSerial

{

public:

    virtual kern_return_t

    Start(IOService * provider) override;

};

but get a lot of errors such as


  "IOUserUSBSerial::handleRxPacket(unsigned char*&, unsigned int&)", referenced from:

      vtable for NewDriver in NewDriver.iig.o

  "IOUserUSBSerial::handleInterruptPacket(unsigned char const*, unsigned int)", referenced from:

      vtable for NewDriver in NewDriver.iig.o

  "IOUserUSBSerial::free()", referenced from:

      vtable for NewDriver in NewDriver.iig.o

  "IOUserUSBSerial::init()", referenced from:

      vtable for NewDriver in NewDriver.iig.o

  "IOUserUSBSerial::initWith(IOBufferMemoryDescriptor*)", referenced from:

      vtable for NewDriver in NewDriver.iig.o

  "IOUserUSBSerial::_Dispatch(IOUserUSBSerial*, IORPC)", referenced from:

      NewDriver::Start_Impl(IOService*) in NewDriver-e6d71af2158103084ce0c1eba7c6088d.o

      NewDriver::_Dispatch(NewDriver*, IORPC) in NewDriver.iig.o

  "vtable for IOUserSerial", referenced from:

      IOUserSerial::IOUserSerial() in NewDriver.iig.o

  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.

  "vtable for IOUserUSBSerial", referenced from:

      IOUserUSBSerial::IOUserUSBSerial() in NewDriver.iig.o

  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.

  "non-virtual thunk to IOUserUSBSerial::free()", referenced from:

      vtable for NewDriver in NewDriver.iig.o

  "non-virtual thunk to IOUserUSBSerial::init()", referenced from:

      vtable for NewDriver in NewDriver.iig.o

  "non-virtual thunk to IOUserUSBSerial::initWith(IOBufferMemoryDescriptor*)", referenced from:

      vtable for NewDriver in NewDriver.iig.o

  "non-virtual thunk to IOUserUSBSerial::handleRxPacket(unsigned char*&, unsigned int&)", referenced from:

      vtable for NewDriver in NewDriver.iig.o

  "non-virtual thunk to IOUserUSBSerial::handleInterruptPacket(unsigned char const*, unsigned int)", referenced from:

      vtable for NewDriver in NewDriver.iig.o

ld: symbol(s) not found for architecture x86_64

If I making any implementations of this methods errors staying on. What Im doing wrong? Is there anywhere examples for USBSerialDriverKit? Didn't find anything on github

Answered by svedm in 747283022

Just forgot to link USBSerialDriverKit.framework :)

Accepted Answer

Just forgot to link USBSerialDriverKit.framework :)

@svedm How do you link against USBSerialDriverKit.framework? Using Xcode 15, I can seem to locate this framework.

Subclassing from IOUserUSBSerial
 
 
Q