gstreamer basic-tutorial-15 编译出现 basic-tutorial-15.c:1: fatal error: clutter-gst/clutter-gst.h......

来源:互联网 发布:加里纳利数据 编辑:程序博客网 时间:2024/06/11 11:33

gstreamer basic-tutorial-15 编译出现 basic-tutorial-15.c:1: fatal error: clutter-gst/clutter-gst.h:No such file or directory

我在windows上遇到这个问题,百思不得其解,我在gstreamer-sdk/include/clutter-1.0下,是可以看到clutter-gst/clutter-gst.h这个文件的。

在ubuntu上用命令编译,还是有这个问题:

$ gcc basic-tutorial-15.c -o basic-tutorial-15  `pkg-config --cflags --libs gstreamer-0.10`

basic-tutorial-15.c:1: fatal error: clutter-gst/clutter-gst.h: No such file or directory
compilation terminated.

后来一个个加头文件位置,出现了一堆链接问题,原来是没有clutter-1.0这个库

gcc basic-tutorial-15.c -o basic-tutorial-15 -I/opt/gstreamer-sdk/include/clutter-1.0 -I/opt/gstreamer-sdk/include/pango-1.0 -I/opt/gstreamer-sdk/include/atk-1.0 -I/opt/gstreamer-sdk/include/cogl -I/opt/gstreamer-sdk/include/cairo -I/opt/gstreamer-sdk/include/json-glib-1.0 `pkg-config --cflags --libs gstreamer-0.10`

/tmp/ccFuIBzB.o: In function `size_change':
basic-tutorial-15.c:(.text+0x26): undefined reference to `clutter_actor_get_stage'
basic-tutorial-15.c:(.text+0x4c): undefined reference to `clutter_actor_get_size'
basic-tutorial-15.c:(.text+0xfe): undefined reference to `clutter_actor_set_position'
basic-tutorial-15.c:(.text+0x114): undefined reference to `clutter_actor_set_size'
basic-tutorial-15.c:(.text+0x143): undefined reference to `clutter_actor_set_rotation'
basic-tutorial-15.c:(.text+0x171): undefined reference to `clutter_actor_animate'
basic-tutorial-15.c:(.text+0x186): undefined reference to `clutter_animation_set_loop'
/tmp/ccFuIBzB.o: In function `main':
basic-tutorial-15.c:(.text+0x1ae): undefined reference to `clutter_gst_init'
basic-tutorial-15.c:(.text+0x1d3): undefined reference to `clutter_stage_get_default'
basic-tutorial-15.c:(.text+0x1e1): undefined reference to `clutter_timeline_new'
basic-tutorial-15.c:(.text+0x20a): undefined reference to `clutter_actor_get_type'
basic-tutorial-15.c:(.text+0x212): undefined reference to `clutter_texture_get_type'
basic-tutorial-15.c:(.text+0x31f): undefined reference to `clutter_timeline_start'
basic-tutorial-15.c:(.text+0x32c): undefined reference to `clutter_group_get_type'
basic-tutorial-15.c:(.text+0x347): undefined reference to `clutter_group_get_type'
basic-tutorial-15.c:(.text+0x3ae): undefined reference to `clutter_actor_get_type'
basic-tutorial-15.c:(.text+0x409): undefined reference to `clutter_group_get_type'
basic-tutorial-15.c:(.text+0x432): undefined reference to `clutter_container_add_actor'
basic-tutorial-15.c:(.text+0x43e): undefined reference to `clutter_actor_show_all'
basic-tutorial-15.c:(.text+0x443): undefined reference to `clutter_main'
collect2: ld returned 1 exit status

所以,我安装了这个库,这下只剩下一个“未定义”

sudo apt-get install clutter-1.0

再次编译:

$ gcc basic-tutorial-15.c -o basic-tutorial-15  `pkg-config --cflags --libs gstreamer-0.10` `pkg-config clutter-1.0 --cflags --libs`
/tmp/ccZwuYzK.o: In function `main':
basic-tutorial-15.c:(.text+0x1ae): undefined reference to `clutter_gst_init'
collect2: ld returned 1 exit status

应该还是安装的库不全,从代码来看,basic-tutorial-15.c中/* clutter-gst takes care of initializing Clutter and GStreamer */

所以又安装了sudo apt-get install clutter-gst-1.0,

然后用以下命令编译成功!

gcc basic-tutorial-15.c -o basic-tutorial-15  `pkg-config --cflags --libs gstreamer-0.10` `pkg-config clutter-1.0 --cflags --libs` `pkg-config clutter-gst-1.0 --cflags --libs`


总结来说,出现如题的问题的原因是 clutter-1.0  clutter-gst-1.0没有安装。

 请看basic-tutorial-15的运行截图:


0 0