Re: [Vala] Using Libraries



Thank you both for your responses. The installation and use of
libraries in Vala makes a lot more sense now. I'll take a crack at
installing and using Gee later this weekend. I might have a follow-up
question or two at that time.

I look forward to creating Vala libraries others can use under an open
source license.

Thank you again.

Landon

On Fri, Aug 31, 2012 at 5:17 AM,  <tarnyko tarnyko net> wrote:
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]