使用新的glib版本编译gstreamer

时间:2015-09-03 15:34:18

标签: compilation gstreamer centos6 glib

我安装了CentOS 6.7。我需要编译GStreamer 1.4.5(或任何1.x),因为CentOS发行版有GStreamer 0.10。 GStreamer 1.x要求GLib2> = 2.32左右,但CentOS有2.28.8。因此,我使用特定位置/ usr / mylibs(作为--prefix param)编译了GLib 2.44.1。

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

现在我正在尝试编译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

直到出现此错误:

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

我错过了什么?请帮忙。

2 个答案:

答案 0 :(得分:1)

您似乎误解了Function JumpToLine(LnNum as String) GoTo LnNum End Function 环境变量的工作原理。它应该包含链接到glib所需的标志;像" -L / usr / mylibs / lib -lglib-2.0"应该工作。

-L ...标志为链接器提供了一个额外的位置来查找共享库(*_LIBS),但在你的标志中,你已经给它一个目录了它需要什么(/ usr / mylibs)和一个子目录(/usr/mylibs/lib/glib-2.0)。 -l ...标志告诉它要查找的特定库,但是你完全省略了它。

答案 1 :(得分:1)

我在CentOS 6.3 VM上遇到了同样的问题。我试图针对glib 2.32.4构建GStreamer 1.4.5。如this message thread所示,当您尝试构建时(而不是2.0版本),似乎链接了不正确的库!而不是在GLIB_CFLAGS中显式定义目录路径,您可以使用PKG_CONFIG_PATH。

找到pkgconfig目录并确保已安装的软件包驻留在那里(如glib-2.0,gobject-2.0,gthread-2.0等)(在我的计算机上,我的路径是:/usr/local/lib/pkconfig/。)我注意到了在您提供的目录列表中,确实有pkgconfig。

首先,导出变量,然后配置,最后制作:

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

GStreamer现在应该正确构建。