Adding linker flags in .pc files

Matt Hoosier mwhoosier at gmail.com
Fri Apr 28 12:30:52 PDT 2006


I'm using CodeSourcery's EABI ARM cross-toolchain (their 2005q3
release, based on gcc 3.4.4 and binutils 2.16.91) to compile a set of
Debian packages for embedded deployment.

The stock 0.61 release of D-BUS compiles and installs cleanly, but ld
consistently fails to find libdbus-1.so.2 (installed in /usr/lib) when
I attempt to link client programs against it. The error message
contains the usual suggestion to add "-rpath /usr/lib" into one's
LDFLAGS. It typically looks like this:

/scratchbox/compilers/arm-xscale-linux-cs344-2.3/bin/../lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/bin/ld:
warning: libdbus-1.so.2, needed by ../gconf/.libs/libgconf-2.so, not
found (try using -rpath or -rpath-link)

A couple of programs which both exhibit this linkage failure and are
available to anybody reading this message would be Imendio's
GConf-over-dbus port and Raphaël Slinckx's little tutorial on how to
do activation:

    http://raphael.slinckx.net/dbustutorial.php

In both cases (gconf-dbus and the activation example), adding
"-Wl,-rpath,/usr/lib" to the LDFLAGS environment variable allows these
(autotools-based) programs which link against D-BUS to finish
building. I can hack this into every dependent package's
specification, but would rather figure out what's causing the library
not to be found.

Has anybody else run into similar linker failures?


More information about the dbus mailing list