Re: [Vala] Using a C library





From: Justin Brown <justin brown fandingo org>
Sent: Saturday, 18 April 2015, 19:22
Subject: [Vala] Using a C library

I'm sure there are some programming errors, but I feel like I can work
through those if I can just figure out how to tell the compiler to use
libspotify/api.h.
If you haven't already worked it out from the example posted, place the attribute:


[CCode (cheader_filename = "libspotify/api.h")]

before your namespace.


You could also rename your spotify.vala file to spotify.vapi and compile it with
valac fandingo.vala --pkg gio-2.0 --pkg spotify --vapidir dir_you_vapi_is_in

A VAPI is just a Vala file with usually a lot more attributes and can be picked up by valac using the --pkg 
filename syntax. I've not come across anything that says a VAPI is more than that, although I would be 
interested if someone could elaborate on the differences between a VAPI file and a plain Vala file.

Al


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