[sane-devel] libusb not available

Olaf Meeuwissen paddy-hack at member.fsf.org
Sat Mar 23 11:08:28 GMT 2019


Hi Pim,

I'm doing a "educated guess" that you are on Ubuntu 18.04.  If that's
wrong, all bets are off.

Pim van Tend writes:

> When I run sudo sane-findscanner -vv from the ubuntu-sane-package, I get:
> ...
> checking /dev/usbscanner15... failed to open (Invalid argument)

# Curious device location.

> found USB scanner (vendor=0x04a9 [Canon], product=0x2225 [CanoScan]) at libusb:001:003
>   # Your USB scanner was (probably) detected. It may or may not be supported by
>   # SANE. Try scanimage -L and read the backend's manpage.
>
>   # Not checking for parallel port scanners.

So that seems to have gone as expected.

> When I run the same with a self-maked sane, I get:
> ...
> checking /dev/usbscanner15... failed to open (Invalid argument)
> libusb not available

No clue as to why that happens.  That library should be somewhere in
your ld.so load path(s), based on the list of installed usb related
packages you list a bit below.

>   # No USB scanners found. If you expected something different, make sure that

Yet this didn't quite go as expected.

> In fact there are many libusb-packages installed:
> libusb-0.1-4/bionic,now 2:0.1.12-31 amd64 [installed]
> libusb-1.0-0/bionic,now 2:1.0.21-2 amd64 [installed]
> libusb-1.0-0-dev/bionic,now 2:1.0.21-2 amd64 [installed]
> libusb-1.0-doc/bionic,bionic,now 2:1.0.21-2 all [installed]
> libusb-dev/bionic,now 2:0.1.12-31 amd64 [installed]
> libusbmuxd4/bionic,now 1.1.0~git20171206.c724e70f-0.1 amd64 [installed]
> python-libusb1/bionic,bionic,now 1.6.3-1 all [installed]

Development packages for libusb-1 and libusb (libusb-0) are present.  Good.

> With libusb-dev removed, you do not get this far. Keeping or removing
> libusb-1.0-0-dev makes no difference.

Weird!  But ...

> Part of the output op ./configure:
> checking for SYSTEMD... no
> checking for USB... no
> checking for USB... no

No?  Do you have pkg-config installed?  Doesn't look like it.

> checking usb.h usability... yes
> checking usb.h presence... yes
> checking for usb.h... yes
> checking for usb_interrupt_read in -lusb... yes

So `./configure` thinks it detected a 10+ years old libusb (or Windows
version of usb ;-/)

> checking lusb0_usb.h usability... no
> checking lusb0_usb.h presence... no
> checking for lusb0_usb.h... no
> checking IOKit/scsi/SCSITaskLib.h usability... no
>
> output from the makeing of sane-find-scanner:
> for subdir in hal hotplug hotplug-ng udev; do \
>   /bin/mkdir -p $subdir || exit 1; \
>   done
> make  all-am
> make[1]: Entering directory '/home/zeeman/backends/tools'
> /bin/bash ../libtool  --tag=CC   --mode=link gcc -Wall -Wextra -pedantic -g -O2   -o sane-find-scanner sane-find-scanner.o check-usb-chip.o ../sanei/libsanei.la ../lib/liblib.la -lusb -lieee1284  ../backend/sane_strstatus.lo
> libtool: link: gcc -Wall -Wextra -pedantic -g -O2 -o sane-find-scanner sane-find-scanner.o check-usb-chip.o ../backend/.libs/sane_strstatus.o  ../sanei/.libs/libsanei.a ../lib/.libs/liblib.a -lusb -lieee1284
> make[1]: Leaving directory '/home/zeeman/backends/tools'

The sane-find-scanner utility links against libusb no problem.

> Is the binary libusb somehow not detected in the configure-process?
> Or something else?

Most likely, you're missing pkg-config.  Try

  sudo apt install pkg-config
  ./configure
  make

Hope this helps,
--
Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Software                        https://my.fsf.org/donate
 Join the Free Software Foundation              https://my.fsf.org/join



More information about the sane-devel mailing list