0

I'm trying to build something against GStreamer from git. They have some magic process that makes pkg-config happy, but if I run it, I get a .la file:

$ pkg-config --libs gstreamer-1.0
/home/blong/gst/head/gstreamer/gst/libgstreamer-1.0.la -lgobject-2.0 -lglib-2.0

And that causes problems for 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

I've read some things suggesting I should be able to use libtool to compile this, but I can't figure out how. What am I supposed to do with this .la file?

Brendan Long
  • 53,280
  • 21
  • 146
  • 188

1 Answers1

0

It figures, right after I asked this, I found this answer by Julien Moutte:

Add :
libtool --mode=link
in front of your build command.

Following that advice, I get this, which works:

libtool --mode=link g++ -o example switchtrackexample.cpp `pkg-config --cflags --libs gstreamer-1.0`
Brendan Long
  • 53,280
  • 21
  • 146
  • 188