Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So here is my PKG_CONFIG_PATH contents:


and here is the output of locate lv2.pc (lv2 is the library I'm trying to link with)


yet here is the output of pkg-config --modversion lv2

Package lv2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `lv2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lv2' found

Any advice? I'm running gentoo fyi. Thanks in advance for any help!!

share|improve this question

/usr/local/lib is a red herring, why is the file in there and not in /usr/lib?

emerge media-libs/lv2

share|improve this answer
I figured it out a while ago actually, sorry for not updating my progress. I found out that the variable doesn't understand PATH syntax, it can only take in the location of one folder. But anyway, for this program (non) it uses bleeding-edge version of lv2, so I had to install latest from svn. Before it did work (when emerged, not compiled from source), probably because it was in /usr/lib rather than /usr/local/lib. Why did this become a red herring? – Athan Clark May 29 '13 at 22:15
Because it is non Portage, there's =media-libs/lv2-9999 in the pro-audio overlay. – Tom Wijsman May 30 '13 at 0:57
up vote 0 down vote accepted

PkgConfig can only understand one location of a folder in the variable, not like PATH's syntax. You need to set it to the one where the location of all of your .pc files are, sadly.

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
share|improve this answer

The manual says differently, you can specify multiple paths for PKG_CONFIG_PATH

From man-pkgconfig

PKG_CONFIG_PATH A colon-separated (on Windows, semicolon-separated) list of directories to search for .pc files. The default directory will always be searched after searching the path;

No so for PKG_CONFIG_LIBDIR however.

PKG_CONFIG_LIBDIR Replaces the default pkg-config search directory.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .