【发布时间】:2012-12-18 18:25:47
【问题描述】:
我正在尝试从 git 构建针对 GStreamer 的东西。他们有一些神奇的过程让pkg-config 开心,但如果我运行它,我会得到一个.la 文件:
$ pkg-config --libs gstreamer-1.0
/home/blong/gst/head/gstreamer/gst/libgstreamer-1.0.la -lgobject-2.0 -lglib-2.0
这会导致 GCC 出现问题:
g++ -o example switchtrackexample.cpp `pkg-config --libs --cflags gstreamer-1.0`
# comes out as: g++ -o example switchtrackexample.cpp -pthread -I/home/blong/gst/head/gstreamer -I/home/blong/gst/head/gstreamer/libs -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include /home/blong/gst/head/gstreamer/gst/libgstreamer-1.0.la -lgobject-2.0 -lglib-2.0
/usr/bin/ld: error: /home/blong/gst/head/gstreamer/gst/libgstreamer-1.0.la:8:8: invalid character
/usr/bin/ld: error: /home/blong/gst/head/gstreamer/gst/libgstreamer-1.0.la:8:8: syntax error, unexpected $end
/usr/bin/ld: error: /home/blong/gst/head/gstreamer/gst/libgstreamer-1.0.la: not an object or archive
# lots of undefined references here
我读过一些东西,建议我应该能够使用libtool 来编译它,但我不知道怎么做。我应该如何处理这个 .la 文件?
【问题讨论】: