Yocto gcc gstreamer glibconfig.h 未找到

问题描述 投票:0回答:1

我正在尝试使用 gstreamer 构建一个简单的单文件 .c 应用程序,将 .mp4 文件流式传输到视频设备。该文件在我的机器上编译并运行良好,但是当使用 BitBake 在 Yocto 中编译时,pkg-config 似乎不可用:

1.0-r0/temp/run.do_compile.1046483: 1: pkg-config: not found

我已将该包添加到我的图像中。 在我安装的食谱中,我有:

IMAGE_INSTALL:append = "\
    pkgconfig \
    gstreamer1.0 \
    gstreamer1.0-dev \
    opencv \
    sample-video \
    v4l-utils \
    usbutils \
    i2c-tools \
    kernel-modules \
    usb-uvc-config \
"

我这样编译我的程序:

DEPENDS += "gstreamer1.0 glib-2.0"

# Cross-compile source code
do_compile(){
${CC} -o stream-sample-to-uvc stream-sample-to-uvc.c -pthread -I${exec_prefix}/include/gstreamer-1.0 -I${exec_prefix}/include/glib-2.0 -I${exec_prefix}/lib/glib-2.0/include -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0
}

但似乎标题未正确包含:

 /usr/include/glib-2.0/glib/gtypes.h:34:10: fatal error: glibconfig.h: No such file or directory
|    34 | #include <glibconfig.h>
|       |          ^~~~~~~~~~~~~~
      |          ^~~~~~~~~~~

如何使用 gstreamer 为我的嵌入式 yocto 板编译程序?

c gcc gstreamer yocto bitbake
1个回答
0
投票

您需要将 gstreamer 添加到您的配方的

DEPENDS
变量中,以便将其拉入您的配方的 sysroot 中。比如:

DEPENDS += "gstreamer1.0 glib-2.0"

构建代码所需的任何内容都应位于

DEPENDS
中。

您的 DEPENDS 中可能需要

gstreamer1.0-dev
。不过,您可能不需要在
IMAGE_INSTALL
中使用它,除非您希望在部署的映像上使用这些标头。

© www.soinside.com 2019 - 2024. All rights reserved.