2

我有旧扫描仪与健全的后端兼容。

我想在我的 Mac (macOS 10.14 Mojave) 上安装健全的后端。

扫描仪是 USB 的,所以libusb需要库。

我做了什么:

我有 MacPorts,所以我从那里安装libusblibusb-compat

然后我从他们的 GitLab 存储库中下载了 sane-backends 的源代码。我在 ./configure 中添加了这些参数:./configure --CFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" BACKENDS='hp5590'我必须使用 CFLAGS 和 LDFLAGS,否则 sane-backends 会给我和错误“找不到 usb.h”或类似的东西。比我只在 BACKENDS 中包含我的扫描仪,因为 有一个错误,make与另一台扫描仪有关。

如果我输入sane-find-scanner它的工作原理。所以我想我已经正确安装了它。

现在有什么问题?

它找不到我的扫描仪。而且......如果我输入sane-find-scanner -v这是结果(我省略了不必要的东西):

This is sane-find-scanner from sane-backends 1.0.27git

[...]

searching for USB scanners:
libusb not available
    # No USB scanners found. If you expected something different, make sure that
    # you have loaded a kernel driver for your USB host controller and have setup
    # the USB system correctly. See man sane-usb for details.
    # SANE has been built without libusb support. This may be a reason
    # for not detecting USB scanners. Read README for more details.

也许有用:

MBP-di-Umberto:~ umberto$ which sane-find-scanner
/opt/local/bin/sane-find-scanner

MBP-di-Umberto:~ umberto$ pkg-config --cflags --libs libusb
-I/opt/local/include -I/opt/local/include/libusb-1.0 -L/opt/local/lib -lusb

MBP-di-Umberto:~ umberto$ port contents libusb
Port libusb contains:
  /opt/local/include/libusb-1.0/libusb.h
  /opt/local/lib/libusb-1.0.0.dylib
  /opt/local/lib/libusb-1.0.a
  /opt/local/lib/libusb-1.0.dylib
  /opt/local/lib/pkgconfig/libusb-1.0.pc

MBP-di-Umberto:~ umberto$ port contents libusb-compat
Port libusb-compat contains:
  /opt/local/bin/libusb-config
  /opt/local/include/usb.h
  /opt/local/lib/libusb-0.1.4.dylib
  /opt/local/lib/libusb.a
  /opt/local/lib/libusb.dylib
  /opt/local/lib/pkgconfig/libusb.pc

编辑

我解决了这个问题。“神奇”*libusb已被发现。我在默认目录(/usr/local)中卸载了 sane-backends 并在没有 CFLAGS 等的情况下重新安装了它。

请确保,如果--prefix./configure使用. 就为了说...--prefixmake uninstall./configure--prefix

*[编辑:我想我一直在使用默认使用 libusb-0.1 的 1.0.25 版本(我有 1.0)。如果你有 libusb-1.0 但你使用的是 sane-backends-1.0.25 你必须将--enable-libusb-1.0参数传递给./configure. 由于libusb-1.0首选版本 1.0.27,因此您不必将偏好设置为./configure --enable.... 我认为这就是“魔法”。]

现在的问题是“设备未配置”</h3>

这就是输出:

searching for USB scanners:
device 0x03f0/0x1305 at 020:005 is not configured
found USB scanner (vendor=0x05ac [Apple Inc.], product=0x821d [Bluetooth USB Host Controller]) at libusb:029:008
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

我也希望蓝牙 USB 主机控制器不在列表中显示。

4

0 回答 0