Re: [Vala] plank-config.c generated by Vala failed to include config.h



On Wed, 2014-08-06 at 21:25 +0800, Leslie Zhai wrote:
Hi Vala developers,

I am a newbie of Vala, and we tried to add gettext support for Plank
Config https://github.com/AOSC-Dev/Plank-Config A tool to config 
Plank Dock.

When make, the errors shown as below:

#error You must define GETTEXT_PACKAGE before including gi18n-lib.h. 
Did
you forget to include config.h?

And I checked the plank-config.c generated by Vala, there is NO 
#include
<config.h> at all!

Then I googled with Vala include config.h beform gi18n.h, it 
suggested
as https://bugzilla.gnome.org/show_bug.cgi?id=618931
Indeed I added some GETTEXT relatived stuff

https://github.com/AOSC-Dev/Plank-Config/commit/40a348a0669724fe7c56fe296000844f1a8e9ef4
But it still failed ;(



My interpretation would be that those were proposed, but not 
implemented, solutions.

Do I need to use -X '-include config.h' for Makefile.am?

https://github.com/AOSC-Dev/Plank-Config/blob/40a348a0669724fe7c56fe296000844f1a8e9ef4/Makefile.am#L11

please someone give me some advice, thanks a lot!



I don't know a perfect answer but it looks like what boxes are doing - 
https://git.gnome.org/browse/gnome-boxes/tree/src/Makefile.am#8 (note 
that you need to add it to _CFLAGS not _VALAFLAGS IIRC as autotools 
use two phase compilation so _VALAFLAGS are applied during Vala -> C 
compilation, not C -> whatever). 

Best regards

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]