configure: error: Need pkg-config to enable libusb support

configure: error: Need pkg-config to enable libusb support

我是 yocto 的新手,我的目标是将打印机驱动程序添加到 imx6 的 yocto 映像中,以便我们可以从板上访问 priter。我正在按照 IMXLXYOCTOUG.PDF.

中的说明尝试构建
$ DISTRO=fsl-imx-xwayland MACHINE=imx6qsabresd source fsl-setup-release.sh -b build_dir
$ source setup-environment build_dir
$ bitbake fsl-image-qt5-validation-imx

基本构建成功,我用 gui 调出板,一切正常。 我想为图像添加打印机支持,所以我添加了元打印 (https://github.com/rossburton/meta-printing) 层。我更新了 bblayer.conf

BBFILES ?= ""
BBLAYERS = " \
  ${BSPDIR}/sources/poky/meta \
  ${BSPDIR}/sources/poky/meta-poky \
  \
  ${BSPDIR}/sources/meta-openembedded/meta-oe \
  ${BSPDIR}/sources/meta-openembedded/meta-multimedia \
  \
  ${BSPDIR}/sources/meta-freescale \
  ${BSPDIR}/sources/meta-freescale-3rdparty \
  ${BSPDIR}/sources/meta-freescale-distro \
  **${BSPDIR}/sources/meta-printing \**

根据 github.

中 README 中的说明

稍后在启动后我无法访问 lp 命令来使用打印机打印一些示例文件。所以我添加了

IMAGE_INSTALL_append = " cups"

在 local.conf 文件中给我以下错误..

| checking for posix_spawn... yes
| checking for tm_gmtoff member in tm structure... yes
| checking for st_gen member in stat structure... no
| checking for removefile... no
| configure: error: Need pkg-config to enable libusb support.
| NOTE: The following config.log files may provide further information.
| NOTE: /home/jifri/on_board/yocto/imx-yocto-bsp/build_dir/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/cups/2.1.4-r0/cups-2.1.4/config.log
| ERROR: configure failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/jifri/on_board/yocto/imx-yocto-bsp/build_dir/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/cups/2.1.4-r0/temp/log.do_configure.8342)
ERROR: Task (/home/jifri/on_board/yocto/imx-yocto-bsp/sources/meta-printing/recipes-printing/cups/cups_2.1.4.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 5414 tasks of which 5399 didn't need to be rerun and 2 failed.

Summary: 2 tasks failed:
  /home/jifri/on_board/yocto/imx-yocto-bsp/sources/meta-epson/recipes-epson/bbepson/bbepson_0.1.bb:do_compile
  /home/jifri/on_board/yocto/imx-yocto-bsp/sources/meta-printing/recipes-printing/cups/cups_2.1.4.bb:do_configure
Summary: There were 4 ERROR messages shown, returning a non-zero exit code.

我在主机 PC 上安装了 pkg-config

$ pkg-config --version
0.29.1

$ sudo apt-get install libusb-0.1-4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libusb-0.1-4 is already the newest version (2:0.1.12-28).
The following packages were automatically installed and are no longer required:
  snap-confine snapd-login-service
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 45 not upgraded.

$ sudo apt-get install libusb-1.0-0-dev
[sudo] password for eldaas: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libusb-1.0-0-dev is already the newest version (2:1.0.20-1).
The following packages were automatically installed and are no longer required:
  snap-confine snapd-login-service
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 45 not upgraded.

知道为什么 配置:错误:需要 pkg-config 来启用 libusb 支持。 正在发生。

或 这是正确的方法吗/是否有更好的方法通过 yocto 在 imx6 上获取 lp 命令 运行。这样我就可以访问打印机了..

任何输入都已预估.. 谢谢。

我也解决了。实际上我已经添加了 meta-printing 层来访问杯子。但是 cups 已经和 meta 层一起存在于 poky (imx-yocto-bsp/sources/poky/meta/recipes-extended/cups) 中。所以我删除了 meta-printing 层,然后用

更新了 build/conf/local.conf

IMAGE_INSTALL_append = "杯数"

这对我有用,启动后我可以在我的 imx6 板上使用 lp、lpadmin 等命令。