bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Still not able to get gettext working


From: Bruno Haible
Subject: Re: Still not able to get gettext working
Date: Sun, 11 Nov 2007 02:24:34 +0100
User-agent: KMail/1.5.4

David Bruce wrote:
> I've been trying very diligently over the last couple of days to get gettext 
> working on my program (tuxmath) - again went through the FAQ and Chapter 13 
> of the gettext manual, and AFAICT I've followed everything, but my program 
> still doesn't call bindtextdomain, textdomain, etc. as if NLS is disabled.  
> 
> I am definitely calling AM_GNU_GETTEXT, and ENABLE_NLS does indeed get set to 
> 1, but gettext is somehow still not activated.  I'm hoping someone can 
> suggest other pitfalls I can look into.

When you say, "ENABLE_NLS gets set to 1", you mean it is defined to 1
in config.h, I assume? Then, normally, this definition should cause
gettext.h to not define gettext and textdomain calls away, and these
warnings should not occur:
> ../../trunk/src/tuxmath.c: In function ‘main’:
> ../../trunk/src/tuxmath.c:35: warning: statement with no effect
> ../../trunk/src/tuxmath.c:36: warning: statement with no effect
> ../../trunk/src/tuxmath.c:37: warning: statement with no effect

So, the best tool to use at this point is "gcc -E" and "gcc -E -dM".
"gcc -E" shows the preprocessed output, and "gcc -E -dM" shows the state
of the macros at the end of the compilation unit. It will be interesting
to see whether ENABLE_NLS, gettext, and textdomain are defined as macros
when you look at "gcc -E -dM".

The two pitfalls that I can think of are:
  - not including <config.h> as the first header file in every compilation
    unit.
  - a #undef ENABLE_NLS hidden somewhere.

> Here are what I think are the relevant snippets
> I apologize for the length of this post

On the contrary, the relevant snippets and attachments help to understand
your problem. People who ask questions but do *not* provide enough relevant
information should apologize!

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]