配置:错误:需要pkg-config才能启用libusb支持

问题描述

我是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中自述文件中的说明进行操作。

启动后,我无法访问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 @R_270_4045@ion.
| 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 @R_270_4045@ion... 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 @R_270_4045@ion... 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 to remove and 45 not upgraded.

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

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

禁止任何输入。 谢谢。

解决方法

我已经解决了同样的问题。实际上,我已经添加了元打印层以访问杯子。但是杯子和poky中的meta层已经存在(imx-yocto-bsp / sources / poky / meta / recipes-extended / cups)。所以我删除了meta-printing层,然后用

更新了build / conf / local.conf

IMAGE_INSTALL_append =“杯子”

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