dbus 1.0 RC2 linker error

Alexander Neundorf neundorf at kde.org
Fri Nov 3 18:12:09 GMT 2006


Hi,

I know this isn't the best list, but I think somebody who knows should be 
around.
So, dbus 1.0 RC2 doesn't link on my Slackware box:


if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..  -DDAEMON_NAME=\"dbus-daemon\"  
-DDBUS_COMPILATION 
-DDBUS_SYSTEM_CONFIG_FILE=\""/usr/etc/dbus-1/system.conf"\" 
-DDBUS_SESSION_CONFIG_FILE=\""/usr/etc/dbus-1/session.conf"\"  
-DDBUS_API_SUBJECT_TO_CHANGE=1   -g -O2 -Wall -Wchar-subscripts 
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith 
-Wcast-align -Wfloat-equal -Wsign-compare -fno-common -fPIC -MT main.o -MD 
-MP -MF ".deps/main.Tpo" -c -o main.o main.c; \
then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 
1; fi
/bin/sh ../libtool --tag=CC --mode=link gcc  -g -O2 -Wall -Wchar-subscripts 
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith 
-Wcast-align -Wfloat-equal -Wsign-compare -fno-common -fPIC   -o dbus-daemon  
activation.o bus.o config-parser.o connection.o desktop-file.o 
dir-watch-dnotify.o dispatch.o driver.o expirelist.o policy.o selinux.o 
services.o signals.o test.o utils.o config-loader-expat.o main.o  
-lexpat   ../dbus/libdbus-convenience.la
mkdir .libs
gcc -g -O2 -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes 
-Wnested-externs -Wpointer-arith -Wcast-align -Wfloat-equal -Wsign-compare 
-fno-common -fPIC -o dbus-daemon activation.o bus.o config-parser.o 
connection.o desktop-file.o dir-watch-dnotify.o dispatch.o driver.o 
expirelist.o policy.o selinux.o services.o signals.o test.o utils.o 
config-loader-expat.o 
main.o  /usr/lib/libexpat.so ../dbus/.libs/libdbus-convenience.a
../dbus/.libs/libdbus-convenience.a(dbus-threads.o)(.text+0xa75): In function 
`_dbus_internal_condvar_wait_timeout':
/home/alex/src/packages/dbus-0.94/dbus/dbus-threads.c:927: undefined reference 
to `pthread_cond_timedwait'
collect2: ld returned 1 exit status
make[2]: *** [dbus-daemon] Error 1
make[2]: Leaving directory `/home/alex/src/packages/dbus-0.94/bus'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/alex/src/packages/dbus-0.94'
make: *** [all] Error 2      

Adding a "-lpthread" manually made it work for me.
It seems -lpthread should be added when linking libdbus.

That's what configure says:
                   D-Bus 0.94
                  ==============

        prefix:                   /usr
        exec_prefix:              ${prefix}
        libdir:                   /usr/lib
        bindir:                   /usr/bin
        sysconfdir:               /usr/etc
        localstatedir:            /usr/var
        datadir:                  /usr/share
        source code location:     .
        compiler:                 gcc
        cflags:                   -g -O2 -Wall -Wchar-subscripts 
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith 
-Wcast-align -Wfloat-equal -Wsign-compare -fno-common -fPIC
        cppflags:                 -DDBUS_API_SUBJECT_TO_CHANGE=1
        cxxflags:                 -g -O2
        64-bit int:               long long
        32-bit int:               int
        16-bit int:               short
        Doxygen:                  no
        xmlto:                    no

        Maintainer mode:          no
        gcc coverage profiling:   no
        Building unit tests:      no
        Building verbose mode:    no
        Building assertions:      no
        Building checks:          yes
        Building SELinux support: no
        Building dnotify support: yes
        Building X11 code:        yes
        Building Doxygen docs:    no
        Building XML docs:        no
        Gettext libs (empty OK):
        Using XML parser:         expat
        Init scripts style:       slackware
        Abstract socket names:    yes
        System bus socket:        /usr/var/run/dbus/system_bus_socket
        System bus address:       
unix:path=/usr/var/run/dbus/system_bus_socket
        System bus PID file:      /usr/var/run/dbus/pid
        Session bus socket dir:   /tmp
        Console auth dir:         /var/run/console/
        Console owner file:       no
        Console owner file path:
        System bus user:          messagebus
        Session bus services dir: /usr/share/dbus-1/services
        'make check' socket dir:  /tmp

Bye
Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net




More information about the kde-core-devel mailing list