Search code examples
objective-cmacosusbiokitdarwin

How can I get the USB Port Number in Mac OS X?


I found out one class IORegistryEntry in IOKit. It has APIs to get the values of the properties. I am trying to use this class, but I am not able to compile.

I have added IOKit and Kernel Frameworks. It throws an compilation error saying:

IORegistryEntry not declared.

If anybody knows how to compile, please let me know.


Solution

  • Have you included the relevant header file?

    #include <IOKit/IORegistryEntry.h>
    

    If you have and you're still getting errors, please provide more details.