[Interest] link error (and probably a dumb question)
thiago.macieira at intel.com
Fri Sep 18 23:31:10 CEST 2015
On Friday 18 September 2015 20:34:56 René J. V. Bertin wrote:
> > The question is why you have dbus and glib in a non-standard path in your
> > system in the first place.
> Did I say I did? They're in the standard locations for an Ubuntu system.
I thought you said they were in /usr/lib64/pkgconfig. But looks like we've
found the actual problem:
> > Not really. It sounds to me that the fault lies with you by installing a
> > badly configured pkg-config in /opt/local/bin and by having that in $PATH
> > ahead of the standard pkg-config.
> It's not badly configured, it's configured with --prefix=/opt/local , see
Unfortunately, that counts as "bad configuration". You may not have known it,
but that's the situation with pkg-config.
If pkg-config has a way of providing extra system paths to its configure script,
you need to use it. if it doesn't, then you need to make sure it's installed
in the same prefix as the compiler and linker.
> > Then please stop talking about paths you don't have. You're the one who
> > brought /usr/lib64 up. You're confusing me.
> OK, but I was under the impression that it was you who mentioned that path
I did, for my system, where it's valid. Then you started talking about it in a
way that made it sound like you had it in your system too.
> >> Hmmm, sounds like it's still a good idea to remove the multiarch paths
> >> from
> >> DEFAULT_LIBDIRS for a Qt to be installed in a prefix like /opt/local .
> >> Presuming only Qt installs .prl files, there best be no confusion between
> >> versions.
> > Does your linker search there by default? If so, why would you remove?
> there = where? Now I'm confused :)
Let's just settle on this: qmake won't remove paths that you specifically
listed. Maybe you have a good reason for them.
The problem was pkg-config, not qmake.
> * I understand that qmake searches in /usr/lib/x86_64-linux-gnu if it's in
> DEFAULT_LIBS and then might do clever things with information obtained from
> the .prl files in that directory
> * That could lead to unforeseen (and maybe inexplicable) effects if you want
> to use the libs and corresponding .prl files from another library
> (/opt/local/lib) => does qmake somehow prioritise prls for the same library
> coming from different directories?
It should search in the same order as the linker: first the ones you listed
with -L and, if it can't find the files, then fall back to the defaults.
> * as far as I can deduce and as long as those locations aren't given
> explicitly via -L, the Ubuntu ld searches in the multiarch directories when
> it hasn't found a -l lib otherwise.
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Interest