libcmmk icon indicating copy to clipboard operation
libcmmk copied to clipboard

Error compiling on macOS

Open ku1ik opened this issue 5 years ago • 1 comments

Hey!

I tried to compile to the project on macOS (High Sierra), but I'm getting this error:

~/p/libcmmk (master=) make cmmk-test
gcc -s -Wall -Wextra -std=c99 -fPIC   -c -o libcmmk.o libcmmk.c
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
mkdir -p out
ar rcs out/libcmmk.a libcmmk.o
gcc -shared -s -Wall -Wextra -std=c99 -fPIC libcmmk.o -o out/libcmmk.so
ld: warning: option -s is obsolete and being ignored
Undefined symbols for architecture x86_64:
  "_libusb_attach_kernel_driver", referenced from:
      _cmmk_detach in libcmmk.o
  "_libusb_claim_interface", referenced from:
      _cmmk_attach in libcmmk.o
  "_libusb_close", referenced from:
      _cmmk_attach in libcmmk.o
      _cmmk_detach in libcmmk.o
  "_libusb_detach_kernel_driver", referenced from:
      _cmmk_attach in libcmmk.o
  "_libusb_exit", referenced from:
      _cmmk_attach in libcmmk.o
      _cmmk_detach in libcmmk.o
  "_libusb_init", referenced from:
      _cmmk_attach in libcmmk.o
  "_libusb_interrupt_transfer", referenced from:
      _send_command in libcmmk.o
  "_libusb_kernel_driver_active", referenced from:
      _cmmk_attach in libcmmk.o
  "_libusb_open_device_with_vid_pid", referenced from:
      _cmmk_attach in libcmmk.o
  "_libusb_release_interface", referenced from:
      _cmmk_detach in libcmmk.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libcmmk] Error 1

I have libusb 1.0.22 installed via homebrew.

ku1ik avatar Aug 25 '18 13:08 ku1ik

I would say even if you are able to compile it, it will be useless for you since USB-HID kernel extension will be in use. That means the libusb cannot access USB hardware. I have already analysed this area when writing LED control command for my CK550, since my original idea was to base my SW on libusb. Probably, the only suitable way is to use Apple IOHIDManager.

vookimedlo avatar Jun 18 '19 20:06 vookimedlo