How to compile C/C++ program with GStreamer

gst/gst.h is provided by libgstreamer1.0-dev. Install it:

sudo apt-get install libgstreamer1.0-dev

In Code::Blocks, you can set custom include locations and linker flags. In the Project menu, click on Build options: enter image description here


For people using Eclipse you should do the followings to make the project from within Eclipse:

Right click the project name and select properties. Under C/C++ Build, select Settings.

  1. Under Tool Settings, open GCC C complier and select miscellaneous. Add the following to other flags text box:

    `pkg-config --cflags gstreamer-1.0` -fPIC
    
  2. Under Tool Settings, open GCC C++ Linker and select miscellaneous. Add the following to linker flags text box:

    `pkg-config --libs gstreamer-1.0 gobject-2.0 glib-2.0`
    
  3. Under Tool Settings, open GCC C++ Linker and select Libraries. Add gstreamer-1.0, gobject-2.0 and glib-2.0 under Libraries section.

Your application should compile and link successfully then.