Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm currently learning Vala, and after going through the basics I wanted to do an actual small project to make it more fun. For this, I thought creating a scope for Unity would be perfect (in this case, a Scope for the Music lens to search MPD).

However, documentation on doing something like this is sparse. Therefore, I hope to be able to put together a tutorial on writing a scope in Vala by first going through it myself with the help of Ask Ubuntu.

What I'm currently stuck on, is how to compile my scope in such a way that I can use Unity's library. I've installed libunity-dev (was this necessary?), however, when I try to compile it, I get the following error:

$ valac --pkg libunity ./unity-scope-mpd.vala
error: Package `libunity' not found in specified Vala API directories or GObject-Introspection GIR directories
Compilation failed: 1 error(s), 0 warning(s)

(Note: I have experience in programming in Java and PHP, but haven't done large projects in the former, so please take that into account in an answer.)

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Doing

 dpkg -L libunity-dev

shows that the vapi file is actually called unity.vapi. Have you tried

valac --pkg unity ./unity-scope-mpd.vala

?

In general, the package name should be equal to the pkg-config name. You can do a ls /usr/lib/pkgconfig to see that there's a unity.pc.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.