`pkg-config --cflags --libs gstreamer-0.10`
以及一些所需庫的安裝
0. 下載gstreamer教程 請參考
http://docs.gstreamer.com/display/GstSDK/Tutorials 說穿了就這行命令
git clonegit://anongit.freedesktop.org/gstreamer-sdk/gst-sdk-tutorials
1. 下載 gstreamer0.1版用的, 注意是0.1版!!若裝成gstreamer1.0版且不安裝0.1版 會在編譯時就出限一堆錯誤
所以很自然的 在Makefile裡要加上
2. 光加上gstreamer庫 教程編譯還是不會過的
gstreamer 大量依賴 glib庫
INC += -I/usr/include/glib-2.0
INC += -I/usr/include/libxml2
INC += -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
(LIB就不用加上lglib-2.0 -lxml2 了 因為libgstreamer0.1自動相依於前兩個庫)
這樣就可以編譯例程一到四號了
3.六號到八號 有用到gtk庫的東西
然後
INC += -I/usr/include/gtk-2.0
INC += -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include
LIB += -lgtk-x11-2.0
4.
LIB += -lgstpbutils-0.10
5. 第五號最麻煩 用到 gdk-pixbuf這庫
然後
INC += -I/usr/include/cairo
INC += -I/usr/include/pango-1.0
INC += -I/usr/include/gdk-pixbuf-2.0
INC += -I/usr/include/atk-1.0
LIB += -lgstinterfaces-0.10
這樣即可
最後附上完整的Makefile (ubuntu 64)
CC := gcc
CFLAGS := -g
INC := -I/usr/include/gstreamer-0.10
INC += -I/usr/include/glib-2.0
INC += -I/usr/include/libxml2
INC += -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
INC += -I/usr/include/gtk-2.0
INC += -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include
INC += -I/usr/include/cairo
INC += -I/usr/include/pango-1.0
INC += -I/usr/include/gdk-pixbuf-2.0
INC += -I/usr/include/atk-1.0
LIB := -L/usr/lib/x86_64-linux-gnu
LIB +=
LIB += -lgtk-x11-2.0
LIB +=
all:
clean: