Reputation: 53
When I perform the command
pkg-config --variable pc_path pkg-config
The output is
/usr/lib64/pkgconfig:/usr/share/pkgconfig
However, there are two other pkgconfig
directories on my system: /usr/lib/pkgconfig
and /usr/local/lib/pkgconfig
If I try
echo $PKG_CONFIG_PATH
the result is
Undefined variable
I also tried to
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
but the response was
export: Command not found.
Now, I have built Gstreamer on multiple occasions and it will put the metadata files (gstreamer-1.0.pc) into the other pkgconfig folder (usr/local/lib/pkgconfig). (I have been able to overcome this issue by modifying the configure file, changing lib to lib64 at the libdir definition.) But I would rather understand my system rather than try work-arounds.
So two questions: where does the pkg-config program get its target directories?
And why and how do the metadata files get put into a directory that is not apparently indicated by the pkg-config program?
Upvotes: 1
Views: 1576
Reputation: 9722
When you install a foo package, foo package has an appropriate foo.pc that gets installed in the default pkgconfig directories. If a package puts its *.pc file in a custom location, as you already know, you should set your PKG_CONFIG_PATH accordingly. So, the pkg-config will not only look in the default directories, but also in the custom path you specified in PKG_CONFIG_PATH. This guide explains it well:
Upvotes: 0
Reputation: 153
Since the command is not working because that variable was not present first check that variable is there or not for to do this execute command env root@localhost:/etc/apt# env if the path is not declare in env then do something like
root@localhost:/etc/apt# PKG_CONFIG_PATH=/usr/local/lib/pkgconfig root@localhost:/etc/apt# export PKG_CONFIG_PATH root@localhost:/etc/apt# echo $PKG_CONFIG_PATH /usr/local/lib/pkgconfig root@localhost:/etc/apt# env
Hope this will work for you for any further help please post the queries with error
Upvotes: 1