My OS (Ubuntu 12.04) comes with a pre-packaged Qt4 libraries and other relevant stuffs. But I wanted to use the latest vanilla Qt 5.2.1, I have installed it and it's working fine, suppose I have compiled this framework which depends on Qt.
What I had to do is to add the Qt 5.2.1 libraries to the $LD_LIBRARY_PATH
. My Qt 5.2.1 home path is /opt/Qt5.2.1/5.2.1/gcc_64
, and thus my $LD_LIBRARY_PATH
contains /opt/Qt5.2.1/5.2.1/gcc_64/lib
(and /opt/Qt5.2.1/Tools/QtCreator/lib
for qtcreator related stuffs)
However, recently I am trying to compile the latest gnu octave. It's configure
script looks for the Qt cflags
(i.e. -l
/-I
/-L
flags) by invoking the pkg-config
.
What I came to know that pkg-config looks for the appropriate .pc
files to get the exact information related to all compilation/linking flags. My system (Ubuntu) maintains a list of all required .pc
file locations in /var/lib/dpkg/info/pkg-config.list
. But I do not have any $PKG_CONFIG_PATH
environment variable on Ubuntu 12.04 (I am not sure why).
My newly installed Qt5 has a set of .pc
files in /opt/Qt5.2.1/5.2.1/gcc_64/lib/pkgconfig/
.
So, how do I make pkg-config to recognize the development libraries in the newly installed Qt 5.2.1 ?
I know that this could be solved by just installing the Qt4 -dev
packages from the Ubuntu repo, but I do not want to do that. I need the vanilla Qt 5.2.1 for other purposes.
NOTE:
- I have added the the path
/opt/Qt5.2.1/5.2.1/gcc_64/lib/pkgconfig/
to the pkg-config.list but the pkg-config does not update the compilation flags accordingly. - Adding the path (
/opt/Qt5.2.1/5.2.1/gcc_64/lib/pkgconfig/
) to$PKG_CONFIG_PATH
does not work as well.
Here is the octave configure script output.