Skip to content

Compiling on Mac OSX Sierra 10.12.2 #17

@DamselDefiler

Description

@DamselDefiler

Hello,
im using your code here since about 5 years now, first on Linux flawless, later on Mac OSX.

  1. XCODE has to be install for g++ i think.
  2. Using homebrew you can install
    libusb-compat
    the wrapper/backport for the old libusb-0.1 which seems to be used as a libusbdev on developing this i assume.
    Still make wont find usb.h
  3. Edit the Make file. The CFLAGS should look like this:
    CFLAGS = -Wall -I/usr/local/Cellar/libusb-compat/0.1.5/include -L/usr/local/Cellar/libusb-compat/0.1.5/lib
    Pointing with I a path to search for the include and L to the libraries.
  4. make will run just fine now, but sudo make install will produce errors
    install -m 4755 usblamp /usr/bin
    install: /usr/bin/usblamp: Operation not permitted
    make: *** [install] Error 71
    Copy it yourself to osx local bin:
    sudo cp usblamp /usr/local/bin/
    and set permissions sudo chmod 4755 /usr/local/bin/usblamp
  5. it worx with:
    ERROR Number: -13 Description: Permission denied
    ERROR Number: -2 Description: No such file or directory
    but it worx!

Other approach would be to use mac ports to install libusb-legacy. Make will throw an error for
"usb_detach_kernel_driver_np". This function should be Linux only, if my research is correct. So you could remove it.
Outcomment this "usb_detach_kernel_driver_np(handler, 0);" in USBLamp.cpp and it will compile with point 4. above.

Happy Mailing :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions