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

René J. V. Bertin rjvbertin at gmail.com
Fri Sep 18 18:06:55 CEST 2015


Thiago Macieira wrote:

> Though Jane Developer will know what's there because she installs libraries
> using the package manager.

Any reason for the gender change? :)

> If the default search path is /usr/lib/x86_64-linux-gnu, then the question is
> why you had to set PKG_CONFIG_PATH.

I think the system pkg-config looks in /usr/lib and then in /usr/lib/<arch>-
linux-gnu . The one from /opt/local is "stock" and thus doesn't know about 
Debuntu multiarch paths (I checked, there's no occurrence of "linux-gnu" in the 
pkg-config source package). So I had to add the path via PKG_CONFIG_PATH.

I've now replaced /opt/local/bin/pkg-config with a wrapper that prepends 
/opt/local/lib/pkgconfig to PKG_CONFIG_PATH and then calls the system pkg-
config. Seems to be the solution I needed, but I'll raise a question about the 
multiarch dirs on the Ubuntu forums.

> If the system uses the Debian-style of
> multiarch, why do you have /usr/lib64?

I don't, and didn't intend to suggest I do...

> needs the full library search path. If the library isn't found after this, it
> assumes it's in a default search path it didn't know about and leaves it to
> the linker.

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.

> Since it will not strip, if you add them, they will be passed to the linker.

That's good, but

>> The question is more if it will add paths to the linker commands.
                                                                   ^ that you 
haven't added to LIBS or LIBS_PRIVATE.

R.




More information about the Interest mailing list