iiiyx
iiiyx

Reputation: 73

Compiling gstreamer with new glib version

I have CentOS 6.7 installed. I need to compile GStreamer 1.4.5 (or any 1.x) because CentOS distribution has GStreamer 0.10. GStreamer 1.x requires GLib2 >= 2.32 or so, but CentOS has 2.28.8. Therefore I compiled GLib 2.44.1 using specific location /usr/mylibs (as --prefix param).

ll /usr/mylibs/lib
total 26008
drwxr-xr-x.  3 root root     4096 Sep  3 16:48 gio
drwxr-xr-x.  3 root root     4096 Sep  3 16:48 glib-2.0
drwxr-xr-x.  3 root root     4096 Sep  3 15:44 libffi-3.2.1
-rwxr-xr-x.  1 root root     1132 Sep  3 16:48 libgio-2.0.la
lrwxrwxrwx.  1 root root       22 Sep  3 16:48 libgio-2.0.so -> libgio-2.0.so.0.4400.1
lrwxrwxrwx.  1 root root       22 Sep  3 16:48 libgio-2.0.so.0 -> libgio-2.0.so.0.4400.1
-rwxr-xr-x.  1 root root  6208700 Sep  3 16:48 libgio-2.0.so.0.4400.1
-rwxr-xr-x.  1 root root     1005 Sep  3 16:48 libglib-2.0.la
lrwxrwxrwx.  1 root root       23 Sep  3 16:48 libglib-2.0.so -> libglib-2.0.so.0.4400.1
lrwxrwxrwx.  1 root root       23 Sep  3 16:48 libglib-2.0.so.0 -> libglib-2.0.so.0.4400.1
-rwxr-xr-x.  1 root root  3172134 Sep  3 16:48 libglib-2.0.so.0.4400.1
-rwxr-xr-x.  1 root root     1059 Sep  3 16:48 libgmodule-2.0.la
lrwxrwxrwx.  1 root root       26 Sep  3 16:48 libgmodule-2.0.so -> libgmodule-2.0.so.0.4400.1
lrwxrwxrwx.  1 root root       26 Sep  3 16:48 libgmodule-2.0.so.0 -> libgmodule-2.0.so.0.4400.1
-rwxr-xr-x.  1 root root    39251 Sep  3 16:48 libgmodule-2.0.so.0.4400.1
-rwxr-xr-x.  1 root root     1060 Sep  3 16:48 libgobject-2.0.la
lrwxrwxrwx.  1 root root       26 Sep  3 16:48 libgobject-2.0.so -> libgobject-2.0.so.0.4400.1
lrwxrwxrwx.  1 root root       26 Sep  3 16:48 libgobject-2.0.so.0 -> libgobject-2.0.so.0.4400.1
-rwxr-xr-x.  1 root root  1188762 Sep  3 16:48 libgobject-2.0.so.0.4400.1
-rwxr-xr-x.  1 root root     1054 Sep  3 16:48 libgthread-2.0.la
lrwxrwxrwx.  1 root root       26 Sep  3 16:48 libgthread-2.0.so -> libgthread-2.0.so.0.4400.1
lrwxrwxrwx.  1 root root       26 Sep  3 16:48 libgthread-2.0.so.0 -> libgthread-2.0.so.0.4400.1
-rwxr-xr-x.  1 root root     9001 Sep  3 16:48 libgthread-2.0.so.0.4400.1
-rw-r--r--.  1 root root   921042 Sep  3 16:15 libpcre16.a
-rwxr-xr-x.  1 root root      931 Sep  3 16:15 libpcre16.la
lrwxrwxrwx.  1 root root       18 Sep  3 16:15 libpcre16.so -> libpcre16.so.0.2.5
lrwxrwxrwx.  1 root root       18 Sep  3 16:15 libpcre16.so.0 -> libpcre16.so.0.2.5
-rwxr-xr-x.  1 root root   618161 Sep  3 16:15 libpcre16.so.0.2.5
-rw-r--r--.  1 root root   893956 Sep  3 16:15 libpcre32.a
-rwxr-xr-x.  1 root root      931 Sep  3 16:15 libpcre32.la
lrwxrwxrwx.  1 root root       18 Sep  3 16:15 libpcre32.so -> libpcre32.so.0.0.5
lrwxrwxrwx.  1 root root       18 Sep  3 16:15 libpcre32.so.0 -> libpcre32.so.0.0.5
-rwxr-xr-x.  1 root root   593479 Sep  3 16:15 libpcre32.so.0.0.5
-rw-r--r--.  1 root root   975726 Sep  3 16:15 libpcre.a
-rw-r--r--.  1 root root    46462 Sep  3 16:15 libpcrecpp.a
-rwxr-xr-x.  1 root root      965 Sep  3 16:15 libpcrecpp.la
lrwxrwxrwx.  1 root root       19 Sep  3 16:15 libpcrecpp.so -> libpcrecpp.so.0.0.1
lrwxrwxrwx.  1 root root       19 Sep  3 16:15 libpcrecpp.so.0 -> libpcrecpp.so.0.0.1
-rwxr-xr-x.  1 root root    43351 Sep  3 16:15 libpcrecpp.so.0.0.1
-rwxr-xr-x.  1 root root      917 Sep  3 16:15 libpcre.la
-rw-r--r--.  1 root root    21720 Sep  3 16:15 libpcreposix.a
-rwxr-xr-x.  1 root root      979 Sep  3 16:15 libpcreposix.la
lrwxrwxrwx.  1 root root       21 Sep  3 16:15 libpcreposix.so -> libpcreposix.so.0.0.3
lrwxrwxrwx.  1 root root       21 Sep  3 16:15 libpcreposix.so.0 -> libpcreposix.so.0.0.3
-rwxr-xr-x.  1 root root    18917 Sep  3 16:15 libpcreposix.so.0.0.3
lrwxrwxrwx.  1 root root       21 Sep  3 16:43 libpcre.so -> /lib/libpcre.so.1.2.5
-rwxr-xr-x.  1 root root   693207 Sep  3 16:47 libpcre.so.1
-rwxr-xr-x.  1 root root   693207 Sep  3 16:47 libpcre.so.1.2.5
-rwxr-xr-x.  1 root root 10381922 Sep  3 16:00 libpython2.7.a
drwxr-xr-x.  2 root root     4096 Sep  3 16:48 pkgconfig
drwxr-xr-x. 28 root root    20480 Sep  3 16:03 python2.7

Now I'm trying to compile GStreamer 1.4.5:

export GLIB_CFLAGS="-I/usr/mylibs/include/glib-2.0 -I/usr/mylibs/lib/glib-2.0/include" && export GLIB_LIBS="-L/usr/mylibs -L/usr/mylibs/lib/glib-2.0" && export GIO_CFLAGS="-I/usr/mylibs/include -I/usr/mylibs/include/gio-unix-2.0" && export GIO_LIBS="-L/usr/mylibs -L/usr/mylibs/lib/gio" && export PYTHON=/usr/mylibs/bin/python
./configure --prefix=/usr/mylib
or
./configure 
make

And it works until this error:

Making all in helpers
make[4]: Entering directory `/root/gstreamer/gstreamer-1.4.5/libs/gst/helpers'
  CC       gst_plugin_scanner-gst-plugin-scanner.o
  CCLD     gst-plugin-scanner
gst_plugin_scanner-gst-plugin-scanner.o: In function `main':
/root/gstreamer/gstreamer-1.4.5/libs/gst/helpers/gst-plugin-scanner.c:45: undefined reference to `g_malloc'
/root/gstreamer/gstreamer-1.4.5/libs/gst/helpers/gst-plugin-scanner.c:55: undefined reference to `g_free'
../../../gst/.libs/libgstreamer-1.0.so: undefined reference to `g_param_spec_object'
../../../gst/.libs/libgstreamer-1.0.so: undefined reference to `g_utf8_validate'
../../../gst/.libs/libgstreamer-1.0.so: undefined reference to `g_date_get_month'
../../../gst/.libs/libgstreamer-1.0.so: undefined reference to `g_value_get_float'
../../../gst/.libs/libgstreamer-1.0.so: undefined reference to `g_checksum_update'
../../../gst/.libs/libgstreamer-1.0.so: undefined reference to `g_memdup'
../../../gst/.libs/libgstreamer-1.0.so: undefined reference to `g_type_interface_peek'
../../../gst/.libs/libgstreamer-1.0.so: undefined reference to `g_value_set_int64'
../../../gst/.libs/libgstreamer-1.0.so: undefined reference to `g_thread_pool_new'
...
../../../gst/.libs/libgstreamer-1.0.so: undefined reference to `g_param_spec_ref'
collect2: ld returned 1 exit status
make[4]: *** [gst-plugin-scanner] Error 1
make[4]: Leaving directory `/root/gstreamer/gstreamer-1.4.5/libs/gst/helpers'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/root/gstreamer/gstreamer-1.4.5/libs/gst'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/gstreamer/gstreamer-1.4.5/libs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/gstreamer/gstreamer-1.4.5'
make: *** [all] Error 2

What have I missed? Please help.

Upvotes: 2

Views: 2118

Answers (2)

chembrad
chembrad

Reputation: 885

I encountered the same problem on my CentOS 6.3 VM. I was attempting to build GStreamer 1.4.5 against glib 2.32.4. As shown in this message thread it would appear that the incorrect libraries are being linked when you attempt to build (not the 2.0 ones!) Rather than explicitly defining the directory paths in GLIB_CFLAGS you could use PKG_CONFIG_PATH.

Locate the pkgconfig directory and ensure packages you have installed reside in there (like glib-2.0, gobject-2.0, gthread-2.0, etc.) (On my computer my path was: /usr/local/lib/pkconfig/.) I noticed in your directory listing that you have provided you do indeed have pkgconfig.

First, export the variable, then configure, and finally make:

export PKG_CONFIG_PATH=/usr/mylibs/lib/pkgconfig/ ./configure make

GStreamer should now build correctly.

Upvotes: 1

nemequ
nemequ

Reputation: 17482

You seem to be misunderstanding how the *_LIBS environment variable works. It should contain the flags needed to link to glib; something like "-L/usr/mylibs/lib -lglib-2.0" should work.

The -L… flag gives the linker an additional place to look for shared libraries (i.e., libglib-2.0.so), but in your flags you've given it one directory above what it needs (/usr/mylibs) and a subdirectory (/usr/mylibs/lib/glib-2.0). The -l… flag tells it what specific library to look for, but you completely omitted it.

Upvotes: 1

Related Questions