[Interest] link error (and probably a dumb question)
René J. V. Bertin
rjvbertin at gmail.com
Thu Sep 17 16:08:49 CEST 2015
Thiago Macieira wrote:
> Find out which variable(s) contains that in mkspecs/*.pri.
> My guess is you're going to find it on variable QT_LIBS_GLIB and the other
> glib-based libraries. If that is it, please check whether the following
> command also produces -L/usr/lib/x86_64-linux-gnu:
In qmodule.pri :
QT_LFLAGS_SQLITE = -L/usr/lib/x86_64-linux-gnu -lsqlite3
QT_LIBS_DBUS = -L/usr/lib/x86_64-linux-gnu -ldbus-1
QT_CFLAGS_DBUS = -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-
QT_HOST_CFLAGS_DBUS = -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-
QT_CFLAGS_GLIB = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-
QT_LIBS_GLIB = -L/usr/lib/x86_64-linux-gnu -lgthread-2.0 -pthread -lglib-2.0
QT_CFLAGS_PULSEAUDIO = -D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/x86_64-
QT_LIBS_PULSEAUDIO = -L/usr/lib/x86_64-linux-gnu -lpulse-mainloop-glib -lpulse -
QMAKE_LIBS_FONTCONFIG = -L/usr/lib/x86_64-linux-gnu -lfontconfig -lfreetype
QMAKE_LIBS_LIBUDEV = -L/usr/lib/x86_64-linux-gnu -ludev
QMAKE_LIBS_XKBCOMMON_EVDEV = -L/usr/lib/x86_64-linux-gnu -lxkbcommon
> pkg-config --libs glib-2.0
> If it does, please file a bug against your distribution's pkg-config. It's
Nope. Grepping the path on -R /usr/lib/pkgconfig confirms that no packages make
this error. However, there's also /usr/lib/x86_64-linux-gnu/pkgconfig, and the
files in there do contain the -L setting. I think that stands to reason.
I don't know exactly how pkg-config is configured, but the command shown above
someone finds .pc files that are in the arch-specific pkgconfig dir, and strips the
It appears that my error was to use the pkg-config from my /opt/local prefix and
teach that one to look in the system dirs using PKG_CONFIG_PATH . When I do the
opposite, use the system pkgconfig and tell it to search /opt/local/lib/pkgconfig
first, I do not get the unwanted -L setting, AND stuff from /opt/local still gets
priority as I'd want.
That notwithstanding, I think there's an issue in your configure script that
causes this because I suppose it too "should never list the -L for default
library search paths", no? There's the awk script that sets DEFAULT_LIBDIRS and
DEFAULT_INCDIRS in a way that adds the arch-specific lib and include directories.
I added a couple of sed expressions that get rid of the unwanted libraries
(which may have helped get rid of my issue), is that something to suggest via a
Thanks for helping me find the issue in any case!
More information about the Interest