I'm trying to build a C++ application with gstreamer using CMake. In my CMakeLists.txt file, gstreamer is included with the following lines:
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)
I can run cmake
without any errors, but make
gives the following error:
fatal error: gst/gst.h: No such file or directory
Gstreamer is installed and I have checked that the gst.h file is located at /usr/include/gstreamer-1.0/gst/gst.h along with the other gstreamer header files.
The following environment variables has been set:
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
I've also checked the output from pkg-config, suggested in another post with similar problem:
$ 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
So why can't the gstreamer header file be found?
(I'm new to both gstreamer and CMake)
pkg_search_module
sets variables which contains include directories and other things about the libraries. Have you used these variable in yourCMakeLists.txt
? See that my post about usage of pkg-config variables in CMake. – Tsyvarev