Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Cannot build on Ubuntu: libusb linking problem #5

Description

@KlfJoat

Background info

$ lsb_release --description --codename
Description:	Ubuntu 19.04
Codename:	disco
$ uname -a
Linux ruatha 5.0.0-27-generic #28-Ubuntu SMP Tue Aug 20 19:53:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I have cloned this and the submodule to my Ubuntu system. I had build essentials, but I had to install a few extra dependencies...

sudo apt install libusb-1.0-0-dev
sudo apt install qt5-default
sudo apt install libqt5svg5-dev

However, now when I try to build, I get the following... (this is after it fails once, so the successful compilation/linking doesn't show up)

$ make
make -C libcmmk
make[1]: Entering directory '/home/klfjoat/src/cmmk_ctrl/libcmmk'
mkdir -p out
ar rcs out/libcmmk.a libcmmk.o
gcc -shared -s -Wall -Wextra -std=c99 -fPIC libcmmk.o -o out/libcmmk.so
gcc -s -Wall -Wextra -std=c99 -fPIC test.o -o out/cmmk-test -lcmmk -lusb-1.0 -Lout/
make[1]: Leaving directory '/home/klfjoat/src/cmmk_ctrl/libcmmk'
test -d build || mkdir build
cd build; qmake PREFIX= ..
make -j -C build
make[1]: Entering directory '/home/klfjoat/src/cmmk_ctrl/build'
g++  -o cmmk_ctrl main.o mainwindow.o KeyboardWidget.o KeyboardButton.o SpeedSlider.o ColorButton.o moc_mainwindow.o moc_KeyboardWidget.o moc_KeyboardButton.o moc_SpeedSlider.o moc_ColorButton.o   -lusb-1.0 -L../libcmmk/out -lcmmk -lQt5Svg -lQt5Widgets -lQt5Gui -lQt5Core /usr/lib/x86_64-linux-gnu/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:171: cmmk_ctrl] Error 1
make[1]: Leaving directory '/home/klfjoat/src/cmmk_ctrl/build'
make: *** [Makefile:11: cmmk_ctrl] Error 2

I've tried troubleshooting, but I'm not a dev. Googling for the ld errors brings up some options, but I tried all the items I found and none worked.

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