使用glib和dbus dbus_g_value_build_g_variant构建Maliit时出错

时间:2012-09-16 20:57:00

标签: ubuntu build makefile glib dbus

我正在尝试在Ubuntu 10.04 32位上构建Maliit(https://wiki.maliit.org/Documentation/Installing)。我有一台Ubuntu 12.04机器,并且构建Maliit在新的Ubuntu上开箱即用,但我需要在10.04上构建它。

我在10.04之前有几个错误,之后谷歌搜索结果是由于过时版本的glib。所以我抓住了最新版本并按照这样构建:

cd /home/$user/Desktop
wget http://ftp.gnome.org/pub/gnome/sources/glib/2.33/glib-2.33.12.tar.xz
unxz glib-2.33.12.tar.xz
tar xvf glib-2.33.12.tar
cd glib-2.33.12
mkdir build-x86
cd build-x86
mkdir /home/$user/glib-2.33
../configure --prefix=/home/$user/glib-2.33
make
make install
export PATH=/home/$user/glib-2.33/bin:$PATH
cp -r /home/$user/glib-2.33/bin/* /usr/bin
cp -r /home/$user/glib-2.33/share/* /usr/share
cp -r /home/$user/glib-2.33/include/* /usr/include
cp -r /home/$user/glib-2.33/lib/* /usr/lib
cp -r /home/$user/glib-2.33/lib/*so* /lib/

构建几乎成功但现在我遇到了以下错误:

make[3]: Entering directory `/home/user/Desktop/maliit-framework-build-desktop-Desktop_Qt_4_8_1_for_GCC__Qt_SDK__Release/examples/apps/gtk2'
g++ -Wl,-O1 -Wl,--as-needed -Wl,-rpath,/home/pclass/QtSDK/Desktop/Qt/4.8.1/gcc/lib -o maliit-exampleapp-gtk2 .obj/exampleapp-gtk.o    -L/usr/X11R6/lib ../../../lib/libmaliit-glib-1.0.so -L/home/pclass/glib-2.33/lib -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lrt -lglib-2.0 -lXext -lX11 -lm
../../../lib/libmaliit-glib-1.0.so: undefined reference to `dbus_g_value_build_g_variant'
../../../lib/libmaliit-glib-1.0.so: undefined reference to `dbus_g_value_parse_g_variant'
collect2: ld returned 1 exit status
make[3]: Leaving directory `/home/user/Desktop/maliit-framework-build-desktop-Desktop_Qt_4_8_1_for_GCC__Qt_SDK__Release/examples/apps/gtk2'
make[2]: Leaving directory `/home/user/Desktop/maliit-framework-build-desktop-Desktop_Qt_4_8_1_for_GCC__Qt_SDK__Release/examples/apps'
make[1]: Leaving directory `/home/user/Desktop/maliit-framework-build-desktop-Desktop_Qt_4_8_1_for_GCC__Qt_SDK__Release/examples'
make: Leaving directory `/home/user/Desktop/maliit-framework-build-desktop-Desktop_Qt_4_8_1_for_GCC__Qt_SDK__Release'
make[3]: *** [maliit-exampleapp-gtk2] Error 1
make[2]: *** [sub-gtk2-make_default] Error 2
make[1]: *** [sub-apps-make_default] Error 2
make: *** [sub-examples-make_default-ordered] Error 2
13:48:42: The process "/usr/bin/make" exited with code 2.
Error while building project maliit-framework (target: Desktop)
When executing build step 'Make'

特别是错误归结为:

../../../lib/libmaliit-glib-1.0.so: undefined reference to `dbus_g_value_build_g_variant'
../../../lib/libmaliit-glib-1.0.so: undefined reference to `dbus_g_value_parse_g_variant'
collect2: ld returned 1 exit status

我不知道这意味着什么,谷歌没有提供任何有用的信息。我认为这可能与Glib和dbus有关。问题是什么?我该如何解决这个问题?请帮我解决这个问题!

1 个答案:

答案 0 :(得分:2)

编译失败,因为它无法找到dbus_g_value_build_g_variant()函数,该函数首次出现在dbus-glib 0.88中,但 Ubuntu 10.04 附带dbus-glib 0.84所以这是问题。

顺便说一句, dbus-glib 0.88 将其毛刺需求提升到 glib-2.24 ,但这对您来说不是一个问题,因为您正在安装 glib- 2.33

您需要安装 dbus-glib 0.88 来修复编译错误。