I am trying to install the MCC DAQ library (https://github.com/mccdaq/uldaq#build-instructions) from github on my Linux machine. I follow the build and installation intructions but some linking error involving libusb
seems to occur. When I try to run the AIn
example I get an undefined symbol
error:
./examples/AIn
Found 1 DAQ device(s)
[0] USB-1608GX: (020D2FF3)
Connecting to device USB-1608GX - please wait ...
/home/dvarx/Downloads/libuldaq-1.2.1/examples/.libs/AIn: symbol lookup error: /home/dvarx/Downloads/libuldaq-1.2.1/src/.libs/libuldaq.so.1: undefined symbol: libusb_has_capability
And the symbol in question is not found in the shared library:
nm /home/dvarx/Downloads/libuldaq-1.2.1/src/.libs/libuldaq.so.1 | grep libusb_has
U libusb_has_capability
When running ./configure && make
I do not get any errors related to libusb
:
...
checking for libusb_init in -lusb-1.0... yes
checking libusb-1.0/libusb.h usability... yes
checking libusb-1.0/libusb.h presence... yes
checking for libusb-1.0/libusb.h... yes
...
I checked and should have the required packages installed:
apt list --installed | grep libusb
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libusb-0.1-4/focal,now 2:0.1.12-32 amd64 [installed]
libusb-1.0-0-dev/focal,now 2:1.0.23-2build1 amd64 [installed]
libusb-1.0-0/focal,now 2:1.0.23-2build1 amd64 [installed]
libusb-1.0-0/focal,now 2:1.0.23-2build1 i386 [installed,automatic]
libusb-1.0-doc/focal,focal,now 2:1.0.23-2build1 all [installed,automatic]
libusbmuxd6/focal,now 2.0.1-2 amd64 [installed,automatic]
One thing I noticed is that if I try to list the symbols in my installed libusb library, no symbols are reported:
nm /lib/x86_64-linux-gnu/libusb-1.0.so.0
nm: /lib/x86_64-linux-gnu/libusb-1.0.so.0: no symbols
I'm not quite sure how I can proceed to debug this issue, maybe someone knows a solution to this?
I was able to resolve this issue in the meantime. The problem was that there was another version of libusb
installed on this particular system and LD_LIBRARY_PATH
contained a path pointing to this version of libusb
. Launching the program with an adjusted LD_LIBRARY_PATH
solved the issue.