Fatal error: gst/gst.h: No such file or directory (using CMake)
Fatal error: gst/gst.h: No such file or directory (using CMake)
我正在尝试使用 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
给出以下错误:
fatal error: gst/gst.h: No such file or directory
Gstreamer 已安装,我已检查 gst.h 文件位于 /usr/include/gstreamer-1.0/gst/gst.h 以及其他 gstreamer 头文件。
已设置以下环境变量:
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 的输出,在另一个 post 中提出了类似的问题:
$ 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 的新手)
事实证明我实际上并没有 link 应用程序的库。将以下两行添加到 CMakeLists.txt 修复了错误(以防其他人犯与我相同的错误):
target_include_directories(videoDemo PRIVATE ${GST_INCLUDE_DIRS})
target_link_libraries(videoDemo ${GST_LIBRARIES})
(videoDemo为应用名称)
我正在尝试使用 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
给出以下错误:
fatal error: gst/gst.h: No such file or directory
Gstreamer 已安装,我已检查 gst.h 文件位于 /usr/include/gstreamer-1.0/gst/gst.h 以及其他 gstreamer 头文件。
已设置以下环境变量:
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 的输出,在另一个 post 中提出了类似的问题:
$ 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 的新手)
事实证明我实际上并没有 link 应用程序的库。将以下两行添加到 CMakeLists.txt 修复了错误(以防其他人犯与我相同的错误):
target_include_directories(videoDemo PRIVATE ${GST_INCLUDE_DIRS})
target_link_libraries(videoDemo ${GST_LIBRARIES})
(videoDemo为应用名称)