Re: [Vala] Include config.h before gi18n-lib.h



2008/12/2 Frédéric Gaudy <fred_gaudy yahoo fr>:
Hi,

I use gettext in my application with this code :

Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALE_DIR);
Intl.textdomain (Config.GETTEXT_PACKAGE);

Config class is corrected filled.

When compiling, it show me this error :
error: #error You must define GETTEXT_PACKAGE before including gi18n-lib.h.
Did you forget to include config.h?

Looking into c file, config.h is just after gi18n-lib.h.
#include <glib/gi18n-lib.h>
#include <config.h>

So, how to force config.h to be include before gi18n-lib.h?

The headers are included in the order that something from them is used
in the file.  If you refer to a variable from config.h you can promote
the include line.  Lots of my files therefore have, just below the
using statements:

private const string some_unique_name = Config.VERSION;

Phil.


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