I'm trying to install glib-2.37.6 (also same problem with glib-2.32.1) and getting this error during configuration:

You must have either have gettext support in your C library, or use the GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html

I previously built gettext, though. To clarify, I'm trying to build a number of things (leading up to gtk+) without actually installing in the usual places, since this is a machine others use; instead, I'm using --prefix= to put everything in a work directory under my home directory.

I tried looking at the logs to see if I could get a clue about whether I needed to set anything else. I also tried looking at the configure script, although I'm not an expert on autoconf. What I found was that the error occurred because gt_cv_have_gettext wasn't set to yes. So then I looked for where it was supposed to get set, so that I could tell what file or whatever it was checking for. But unless I'm missing something, the only command that would set it to yes is underneath this if:

  if test "$gt_cv_func_dgettext_libc" != "yes" \
     || test "$gt_cv_func_ngettext_libc" != "yes" \
     || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then

The config.log (looking at the configure line numbers) indicates that the condition was false, so everything inside (including the command to set gt_cv_have_gettext) was skipped. But the test seems to check that none of three things are missing. And none of them are; here's one of the last segments of config.log right before the error:

configure:7982: checking for ngettext in libc
configure:8000: gcc -o conftest -g -O2   conftest.c  >&5
configure:8000: $? = 0
configure:8009: result: yes
configure:8013: checking for dgettext in libc
configure:8031: gcc -o conftest -g -O2   conftest.c  >&5
configure:8031: $? = 0
configure:8040: result: yes
configure:8047: checking for bind_textdomain_codeset
configure:8047: gcc -o conftest -g -O2   conftest.c  >&5
configure:8047: $? = 0
configure:8047: result: yes
configure:8323: checking for msgfmt

(The line that would set gt_cv_have_gettext is somewhere between 8047 and 8323.) So unless I'm missing something, it looks as though if all these three things--ngettext, dgettext, bind_textdomain_codeset--are present (or succeed, or something), then an error will result.

So what am I missing? Is there some other option that needs to be set, or something else wrong with my configuration? Or did I find an error in the configure script? Thanks for any help. I wanted to ask in a forum like this before submitting it as a bug report.

2 Answers 2


OK, I think I figured it out. Since I was "installing" everything in a directory under my home directory, I needed to add the "bin" subdirectory of the --prefix directory to my $PATH before running configure. That made it find msgfmt and, I think, got it around the error.

  • 1
    Great question--thanks for posting it, and following up with the solution to help others! Ordinarily it is possible to specify a prefix whose bin directory isn't in PATH (or even without a pre-existing bin directory). But when building requires the use of tools that are actually installed in $PREFIX/bin, that directory does indeed need to be in PATH. Aug 29, 2013 at 14:03
  • Yeah, that sounds very weird, normally when configuring the bin variable is set as $PREFIX/bin as said Eliah. Maybe I need to build glib again to test this. BTW, have you not used the jhbuild tool instead to do this? Also the pkgconfig path that so many headaches gave me in the past, wouldn't be interfering with your installation
    – Braiam
    Aug 29, 2013 at 14:14
  • @Braiam: If your question is intended for me, I don't know what jhbuild is. I'm not an expert at GNU builds; I just try to follow the installation instructions. Maybe it's something I'll have to read up on ...
    – ajb
    Aug 29, 2013 at 14:57

how to add the "bin" subdirectory of the --prefix directory to my $PATH before running configure. That made it find msgfmt and, I think, got it around the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.