Colorsair icon indicating copy to clipboard operation
Colorsair copied to clipboard

How do I compile this?

Open 1hella opened this issue 7 years ago • 2 comments

I'm trying to install this on MacOS.

I did brew install libusb-compat to install libusb, and then I tried g++ *.cpp -o output -std=c++14.

Is this correct?

My output is this:

In file included from main.cpp:15:
./TransitionEffect.hpp:37:13: warning: control reaches end of
      non-void function [-Wreturn-type]
            }
            ^
./TransitionEffect.hpp:18:13: note: in instantiation of member
      function
      'colorsair::TransitionEffect<colorsair::CyclicColorProvider>::tick'
      requested here
            TransitionEffect(std::chrono::milliseconds d...
            ^
main.cpp:32:51: note: in instantiation of member function
      'colorsair::TransitionEffect<colorsair::CyclicColorProvider>::TransitionEffect'
      requested here
            TransitionEffect<CyclicColorProvider> transi...
                                                  ^
1 warning generated.
Undefined symbols for architecture x86_64:
  "_libusb_claim_interface", referenced from:
      colorsair::Device::openInterface(int) in Device-084cb4.o
  "_libusb_close", referenced from:
      colorsair::Device::~Device() in Device-084cb4.o
  "_libusb_detach_kernel_driver", referenced from:
      colorsair::Device::detachKernelDriver() in Device-084cb4.o
  "_libusb_exit", referenced from:
      colorsair::Device::cleanup() in Device-084cb4.o
  "_libusb_free_device_list", referenced from:
      colorsair::Device::cleanup() in Device-084cb4.o
  "_libusb_get_device_list", referenced from:
      colorsair::Device::openDevice(unsigned short, unsigned short) in Device-084cb4.o
  "_libusb_init", referenced from:
      colorsair::Device::initialize() in Device-084cb4.o
  "_libusb_interrupt_transfer", referenced from:
      colorsair::Device::writeInterrupt(unsigned char, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >) in Device-084cb4.o
  "_libusb_kernel_driver_active", referenced from:
      colorsair::Device::detachKernelDriver() in Device-084cb4.o
  "_libusb_open_device_with_vid_pid", referenced from:
      colorsair::Device::openDevice(unsigned short, unsigned short) in Device-084cb4.o
  "_libusb_reset_device", referenced from:
      colorsair::Device::reset() in Device-084cb4.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

1hella avatar Aug 13 '18 16:08 1hella

Mac OS X is pretty awful for USB support; I've worked on ckb-next and I'm reasonably sure libusb simply can't handle the large amount of hoops Mac OS X requires you to jump through to get it working.

Speaking of ckb-next, I believe Chlorek said he wanted to come work on support for this stuff in there, so you never know.

Ravenslofty avatar Aug 15 '18 20:08 Ravenslofty

I used this command "g++ *.cpp -o output -std=c++14 -lusb-1.0"

musdasch avatar Apr 25 '20 10:04 musdasch