Re: [Vala] Using Libraries



Hi Landon,
I'm having a little trouble figuring out how to use libraries in a
Vala program. I understand how to import a namespace and how to
include the library in my command to the compiler. But how do I
install a library in the proper location so I don't get a compiler
warning about a missing namespace?

You need 2 components :
- the library itself, correctly installed (.h files in /usr/include, .so files in /usr/lib...) Under Linux, the package manager automatically takes care of this : "apt-get install ..." - the corresponding .vapi file in /usr/share/vala/vapi/.
What if I want to use the Gee library on Ubuntu?

apt-get install libgee-dev It already includes the .vapi.
if I want to compile against the GTK 3.0 library on Windows

Under Win32 with MinGW, You install the library using the MinGW package manager, and put the .vapi in C:\ProgramData\vala-<version>\vapi. Specific here. MinGW doesn't provide GTK+3 for now. But you'll find it by typing "gtk+3 win32" in Google.
Tarnyko



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]