Re: [Vala] Using gettext


In file included from
/usr/include/glib-2.0/glib/gi18n-lib.h:29:2: error: #error You must
define GETTEXT_PACKAGE before including gi18n-lib.h. Did you forget to
include config.h?
/home/raster/workspace/cronopete/cronopete.vala.c: In function
/home/raster/workspace/cronopete/cronopete.vala.c:527:11: error:
?GETTEXT_PACKAGE? undeclared (first use in this function)
/home/raster/workspace/cronopete/cronopete.vala.c:527:11: note: each
undeclared identifier is reported only once for each function it
appears in
error: cc exited with status 256

I tried the Sampala sample code (
), and it compiles with the Makefile, but returns the same error if I
try to compile it directly with vala.

you can try to use the -X option of valac to define GETTEXT_PACKAGE (e.g.: valac -X -D'GETTEXT_PACKAGE="sampala"' ...).

You may also want to have a look at the config.vapi file inside the vapi directory of sampala: when everything is configured in sampala, GETTEXT_PACKAGE is defined in a C header config.h. The config.vapi file allows you to use some of the information of the config.h in a vala program.


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