[Interest] link error (and probably a dumb question)

Thiago Macieira thiago.macieira at intel.com
Thu Sep 17 18:21:43 CEST 2015


On Thursday 17 September 2015 16:08:49 René J. V. Bertin wrote:
> QT_LIBS_DBUS = -L/usr/lib/x86_64-linux-gnu -ldbus-1

> QT_LIBS_GLIB = -L/usr/lib/x86_64-linux-gnu -lgthread-2.0 -pthread -lglib-2.0

> > 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 -L setting.

The files do contain the -L setting but pkg-config should strip them out.

$ grep Libs: /usr/lib64/pkgconfig/{dbus-1,glib-2.0}.pc
/usr/lib64/pkgconfig/dbus-1.pc:Libs: -L${libdir} -ldbus-1
/usr/lib64/pkgconfig/glib-2.0.pc:Libs: -L${libdir} -lglib-2.0 

$ pkg-config --libs dbus-1 glib-2.0
-ldbus-1 -lglib-2.0 

Yours didn't.

> 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.

Ok, sounds like a detail I didn't know about PKG_CONFIG_PATH.

> 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? 

Right.

> 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 bug report?

Those variables are for qmake's internal use, it doesn't apply to pkg-config. 
If your pkg-config printed those paths, then pkg-config has a prpblem.


-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list