Search code examples
gtk3vala

Adding atspi-2 to the PKG_CONFIG_PATH


I'm currently trying to learn Vala, but it fights me right from the start. I've basically copied the first Basic Sample found here.

I'm trying to build it using this command:

 valac --pkg gtk+-3.0 <filename>.vala

but I'm constantly getting this error message:

Package atspi-2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `atspi-2.pc'
to the PKG_CONFIG_PATH environment variable
Package 'atspi-2', required by 'atk-bridge-2.0', not found
error: pkg-config exited with status 256
Compilation failed: 1 error(s), 0 warning(s)

I have no idea what any of this means nor how to fix this.

Using elementary OS Freya (built on top of Ubuntu 14.04) if that info is needed.


Solution

  • You need the development package for atspi-2.

    apt-get install libatspi2.0-dev
    

    In the future, you can find out which packages contain a file by searching on the packages.ubuntu.com site (or, if Elementary OS provides something, you could use that instead). There is also Debian's package search, or the apt-file command line tool.

    And, in case anyone from the Fedora/RHEL/CentOS side of things stumbles upon this question, dnf provides '*/atspi-2.pc' (or whatever the package name you're looking for is). Actually, you can just do dnf install /usr/lib64/pkgconfig/atspi-2.pc (or /usr/lib/… if you're on 32-bit) there.