Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build errors libusb #32

Open
aznoohwee opened this issue Apr 22, 2021 · 0 comments
Open

build errors libusb #32

aznoohwee opened this issue Apr 22, 2021 · 0 comments

Comments

@aznoohwee
Copy link

aznoohwee commented Apr 22, 2021

On Ubuntu 20.04.2 LTS, the following additional steps were required build and test the library.

Build Issues

Per README.md the instructions indicate to install libusb-1.0.0. I installed libusb-1.0.0-dev, however I received the following errors when attempting to compile:

nu/libGL.so -lpthread   
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_get_device_descriptor'
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_open_device_with_vid_pid'
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_close'
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_init'
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_detach_kernel_driver'
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_kernel_driver_active'
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_attach_kernel_driver'
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_free_device_list'
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_claim_interface'
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_interrupt_transfer'
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_get_device_list'
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_exit'
/usr/bin/ld: ../libcmmk/out/libcmmk.so: undefined reference to `libusb_release_interface'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:172: cmmk_ctrl] Error 1
make[1]: Leaving directory '/home/tdo/Projects/cmmk_ctrl/build'
make: *** [Makefile:11: cmmk_ctrl] Error 2

I resolved the error by install the libusb-dev package which included resulted in the following packages being installed:

ii  libusb-0.1-4:amd64     2:0.1.12-32      amd64        userspace USB programming library
ii  libusb-1.0-0:amd64     2:1.0.23-2build1 amd64        userspace USB programming library
ii  libusb-1.0-0-dev:amd64 2:1.0.23-2build1 amd64        userspace USB programming library development files
ii  libusb-1.0-doc         2:1.0.23-2build1 all          documentation for userspace USB programming
ii  libusb-dev             2:0.1.12-32      amd64        userspace USB programming library development files

I suspect, that the references are due to depreciated functions in libusb-1.0 that were a part of libusb-0.1. For an update - I suggest the documentation be updated to reference libusb-dev or to update the code to only rely on libusb-0.1-4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant