Page 1 of 1

libusb1 upgrade

Posted: 2020/02/28 20:11:55
by tonyroosh
Hi to all,

I'm trying to install an updated version of the libusb1 in my centos system. The system is already equipped with the libusb1.0.9 version which seems to be too old for compiling my dll. The error in compilation is:

Code: Select all

error: ‘libusb_hotplug_callback_handle’ does not name a type
  libusb_hotplug_callback_handle libusbHandle;

This was actually expected and seems that can be solved using an updated libusb1 version (if i'm not wrong starting from libusb1.0.12). Now starts (for me) the difficult part. I've managed to download the installation files for the libusb1.0.12 and also to install it by running:

Code: Select all

./bootstrap.sh
./configure
make
sudo make install
but now i need to link the libusb and this is where i got stucked.

Here you can find the output of my "make install" command:

Code: Select all

[tony@localhost libusb-1.0.12]$ sudo make install
Making install in libusb
make[1]: Entering directory `/home/tony/Desktop/libusb-1.0.12/libusb'
make[2]: Entering directory `/home/tony/Desktop/libusb-1.0.12/libusb'
test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libusb-1.0.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libusb-1.0.so.0.1.0 /usr/local/lib/libusb-1.0.so.0.1.0
libtool: install: (cd /usr/local/lib && { ln -s -f libusb-1.0.so.0.1.0 libusb-1.0.so.0 || { rm -f libusb-1.0.so.0 && ln -s libusb-1.0.so.0.1.0 libusb-1.0.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libusb-1.0.so.0.1.0 libusb-1.0.so || { rm -f libusb-1.0.so && ln -s libusb-1.0.so.0.1.0 libusb-1.0.so; }; })
libtool: install: /usr/bin/install -c .libs/libusb-1.0.lai /usr/local/lib/libusb-1.0.la
libtool: install: /usr/bin/install -c .libs/libusb-1.0.a /usr/local/lib/libusb-1.0.a
libtool: install: chmod 644 /usr/local/lib/libusb-1.0.a
libtool: install: ranlib /usr/local/lib/libusb-1.0.a
libtool: finish: PATH="/sbin:/bin:/usr/sbin:/usr/bin:/sbin" ldconfig -n /usr/local/lib
ldconfig: /usr/local/lib/libstdc++.so.6.0.22-gdb.py is not an ELF file - it has the wrong magic bytes at the start.

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "/usr/local/include/libusb-1.0" || /bin/mkdir -p "/usr/local/include/libusb-1.0"
 /usr/bin/install -c -m 644 libusb.h '/usr/local/include/libusb-1.0'
make[2]: Leaving directory `/home/tony/Desktop/libusb-1.0.12/libusb'
make[1]: Leaving directory `/home/tony/Desktop/libusb-1.0.12/libusb'
Making install in doc
make[1]: Entering directory `/home/tony/Desktop/libusb-1.0.12/doc'
make[2]: Entering directory `/home/tony/Desktop/libusb-1.0.12/doc'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/tony/Desktop/libusb-1.0.12/doc'
make[1]: Leaving directory `/home/tony/Desktop/libusb-1.0.12/doc'
make[1]: Entering directory `/home/tony/Desktop/libusb-1.0.12'
make[2]: Entering directory `/home/tony/Desktop/libusb-1.0.12'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p "/usr/local/lib/pkgconfig"
 /usr/bin/install -c -m 644 libusb-1.0.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory `/home/tony/Desktop/libusb-1.0.12'
make[1]: Leaving directory `/home/tony/Desktop/libusb-1.0.12'
[tony@localhost libusb-1.0.12]$ 
Which is the correct way to link the new library? It seems (by running cmake script of my dll) that only the old libusb1.0.9 is found.

Thanks in advance for your help.

Antonio

Re: libusb1 upgrade

Posted: 2020/02/28 22:44:11
by TrevorH
The correct way is nothing like the way you're trying. CentOS 6 has about 6 months of life left so you need to get off it ASAP. And since libusb1 is something that we provide, there is no supported way in which to upgrade it without causing yourself problems.

I'd recommend switching to CentOS 7 or 8 but neither of those seem to ship a package called libusb1, they only have libusb which is at 0.1.4-3.el7 and 0.1.5-12.el8.

What are you trying to build that still uses the archaic libusb1?

Re: libusb1 upgrade

Posted: 2020/02/28 22:55:18
by sml
libusb1 on CentOS 7 and 8 (and in every Fedora release starting with Fedora 18) is provided by package libusbx. They're libusbx-1.0.21-1.el7 and libusbx-1.0.22-1.el8, respectively. From the package description:
Libusbx is a fork of the original libusb, which is a fully API and ABI compatible drop in for the libusb-1.0.9 release.