PDA

View Full Version : dbus.cpp:(.text+0x8):undefined reference to 'dbus_shutdown'



to_guliang
17th August 2010, 10:09
hi, everyone.
i want to cross compiled Qt/Embedded with dbus support, but i get the error as the title.
now i describe the situation:
1. if I cross compiled Qt/Embedded without dbus, i can succeed.
2. Then i cross compiled the dbus-1.2.4.6 and add "-dbus -I/usr/local/dbus/include/dbus-1.0 -I/usr/local/dbus/lib/dbus-1.0/include -L/usr/local/dbus/lib" in the ./configure. "usr/local/dbus" is the path where i install the dbus.
But the ./configure cannot succeed.

thanks very much for any suggestion!!!

to_guliang
18th August 2010, 01:33
later, i try the following methods:
1. add "-ldbus-1" follow with "L/usr/local/dbus/lib", i get error "cannot find -ldbus-1".

2. configure with " -force-pkg-config " and "export PKG_CONFIG_PATH=/usr/local/dbus/lib/pkgconfig"

"/usr/local/dbus " is the dir where dbus lib installed . i still get error "cannot find -ldbus-1".

then i find "-ldbus-1" in my ubuntu and google, i cann't find any information about it.

could you help me? thanks very much!!

to_guliang
18th August 2010, 08:51
i have solved the problem. the cross-compile dbus has some problem result in the error.

1.download dbus-1.2.4.6.tar.gz and expat-2.0.1.tar.gz

2. cross-compile expat



tar zxvf expat-2.0.1.tar.gz
cd expat-2.0.1/
./configure --host=arm-linux --prefix=/usr/local/expat/ CC=arm-linux-gcc
make; make install

3. cross-compile dbus


tar zxvf dbus-1.2.24.tar.gz
cd dbus-1.2.24
./configure --prefix=/usr/local/dbus/ --host=arm-linux --with-x=no ac_cv_have_abstract_sockets=yes "CC=arm-linux-gcc -I/usr/local/expat/include -L/usr/local/expat/lib"

make;make install;


4. cross-compile Qt with dbus


a.export PKG_CONFIG_PATH=/usr/local/dbus/lib/pkgconfig
b.configure with " -dbus " and " -force-pkg-config "

simon87s
25th January 2013, 14:27
After I was confronted with this error using qt 4.8.4(for embedded) and dbus 1.4.20 I want to give another solution, which works for me:

The Error occurs because the test applikation in config.tests/unix/dbus/ is compiled (found Headers) but was not linked against "libdbus-1.so" !
So when configuring QT add a "-ldbus-1" at end. (same problem occurs with DirectFB: add -ldirect and -ldirectfb)

Vigneshkumar
4th April 2013, 13:40
Hi guliang,

By following your above thread i solved the issue of dbus.

./configure -embedded arm -xplatform qws/linux-arm-g++ -qt-kbd-linuxinput -qt-mouse-tslib -webkit -glib -dbus -force-pkg-config -opensource -verbose -R /usr/local/tslib/lib/

Actually i am trying to give glib support for my QT (I am really need that)

In that i am getting error

cc1plus: warning: include location "/usr/include/glib-2.0" is unsafe for cross-compilation
glib.cpp: In function 'int main(int, char**)':
glib.cpp:55: warning: 'pollfd' is used uninitialized in this function
arm-none-linux-gnueabi-g++ -Wl,-O1 -o glib glib.o -L/usr/local/tslib/lib -pthread -lgthread-2.0 -lrt -lglib-2.0
/opt/codesourcery/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgthread-2.0
collect2: ld returned 1 exit status
make: *** [glib] Error 1
Glib disabled.
Glib support cannot be enabled due to functionality tests!
Turn on verbose messaging (-v) to ./configure to see the final report.
If you believe this message is in error you may use the continue
switch (-continue) to ./configure to continue.

Can u please help me. Waiting for your reply...

Thanks in Advance,

Vignesh