Re: [Vala] Difference between setting "vapidir" and adding a .vapi file (was "Global key shortcuts")



On Sat, 2016-08-20 at 11:09 +0200, rastersoft wrote:
Hi:

Finally I found the library "keybinder". It doesn't work no wayland,
but
at least allows me to do what I need in X.

But now I have a problem: the VAPI file isn't available in my system,
so
I'm adding it manually. But here comes the odd thing: if I specify
the
VAPI file in the command line, it doesn't compile:

    valac -C captura.vala --pkg=gtk+-3.0 --pkg=keybinder-3.0
keybinder-3.0.vapi
    error: Package `keybinder-3.0' not found in specified Vala API
directories or GObject-Introspection GIR directories
    Compilation failed: 1 error(s), 0 warning(s)

But if I just set a "vapidir" with the folder that contains the .vapi
file, everything works fine.

    valac -C captura.vala --pkg=gtk+-3.0 --pkg=keybinder-3.0 --
vapidir=.

But with other projects, just adding the .vapi files worked fine
(like
the Autovala plugin for Gedit or Scratch, or a plugin for
GnomeBuilder
that I'm writing). In both cases the libraries are available system-
wide.

So... why does this happen? And what is the difference between just
specifying a .vapi file or putting a --vapidir parameter?

Don't provide both the full path to the vapi and a --pkg argument (with
--vapidir if necessary).  Use one or the other.

That said, I can't actually reproduce this; I just get a bunch of
errors about all the symbols having already been declared (since valac
tries to load the same vapi twice).  Maybe you're running an older
version of valac, or those aren't really the commands you're using?


-Evan

Attachment: signature.asc
Description: This is a digitally signed message part



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