【发布时间】:2018-05-03 10:53:55
【问题描述】:
我正在尝试使用 CMake 使用 gstreamer 构建 C++ 应用程序。在我的 CMakeLists.txt 文件中,gstreamer 包含在以下几行中:
find_package(PkgConfig REQUIRED)
pkg_search_module(GST REQUIRED gstreamer-1.0>=1.4
gstreamer-sdp-1.0>=1.4
gstreamer-video-1.0>=1.4
gstreamer-app-1.0>=1.4)
我可以运行cmake 没有任何错误,但make 给出以下错误:
致命错误:gst/gst.h:没有这样的文件或目录
Gstreamer 已安装,我已检查 gst.h 文件是否位于 /usr/include/gstreamer-1.0/gst/gst.h 以及其他 gstreamer 头文件。 p>
已设置以下环境变量:
export PKG_CONFIG_PATH=/opt/qt-5.9.1/lib/pkgconfig
export LD_LIBRARY_PATH=/opt/qt-5.9.1/lib
export GST_PLUGIN_PATH=/usr/include/gstreamer-1.0
我还检查了 pkg-config 的输出,在另一篇有类似问题的帖子中建议:
$ pkg-config --cflags gstreamer-1.0
-pthread -I/usr/include/gstreamer-1.0 -I/usr/lib/x86_64-linux-gnu/gstreamer-1.0/include -I/usr/include/glib-2.0 -I/usr/x86_64-linux-gnu/glib-2.0/include
那么为什么找不到gstreamer头文件呢?
(我是 gstreamer 和 CMake 的新手)
【问题讨论】:
-
pkg_search_module设置变量,其中包含包含目录和有关库的其他内容。你在CMakeLists.txt中使用过这些变量吗?有关在 CMake 中使用 pkg-config 变量的信息,请参阅 that my post。