Compiler error - msgfmt command not found
Asked Answered
S

11

106

I'm trying to update Git from my shared hosting. For that I'm following these steps:

  1. Download latest Git version
  2. Unpack and place it on the server
  3. Configure and create the Makefile -> ./configure --prefix=$HOME/dev/git/src --without-tcltk
  4. Build the package -> make then make install
  5. Update PATH .bash_profile

I'm stuck at point 4. When I run the make command, I get the following:

user@ssh1:~/dev/git/src$ make
SUBDIR gitweb
SUBDIR ../
make[2]: ? GIT-VERSION-FILE ? est ? jour.
GEN git-instaweb
SUBDIR perl
SUBDIR git_remote_helpers
SUBDIR templates
MSGFMT po/build/locale/is/LC_MESSAGES/git.mo
/bin/sh: msgfmt: command not found
make: *** [po/build/locale/is/LC_MESSAGES/git.mo] Erreur 127

Compiler throws a msgfmt command not found error.

I Googled it and it seems to be related to the gettext package.

Any idea how to fix that error on a shared hosting?

Sheepshanks answered 29/2, 2012 at 14:28 Comment(3)
Quick hack: try "make -k" or "make -i" to skip compiling this, may be you will get Git, but without localization and/or documents.Snuggery
You're right msgfmt is not vital to run Git. "make -i" worked thanks.Sheepshanks
For OSX you can find the answer here https://mcmap.net/q/205414/-pygettext-py-and-msgfmt-py-on-mac-os-xIconoscope
B
291

I had the same issue. Thanks to your work on finding it was related to gettext, a simple apt-get install gettext fixed it for me.

Berdichev answered 15/3, 2012 at 14:59 Comment(7)
This should be acceped answer ;)Ctenidium
This certainly seems like the best answer, however, on cygwin, installing gettext did not help. Perhaps a version issue there?Hunkers
This is not the right answer on shared hosting, where you don't have sudo access.Parliamentarian
@Hunkers on cygwin you need gettext-devel for msgfmt (see this helpful answer)Nide
When installing from source/on a system without root access, run ./configure && make && make install in the gettext-tools subdirectory below the gettext source root.Helvetian
Thank you! Me: in centos: yum install gettextHeterogeneity
how do i install it in windows 10? I didn't find any reliable guide for windows setup of gettext.Kandace
I
19

While building Git with Xcode (using Makefile), I had to define NO_GETTEXT = YesPlease in the Makefile to resolve this issue.

Isotron answered 16/6, 2012 at 20:52 Comment(1)
Preferred this, as I couldn’t install gettext, and -i (ignore errors) is just daft! make NO_GETTEXT=1 did the trick.Susan
P
18

msgfmt is included in the gettext-devel cygwin package. Install that (via setup.exe or apt-cyg) and the error should go away.

Pharyngoscope answered 3/3, 2014 at 23:37 Comment(2)
The question is not about CygwinIndolent
gettext-devel is also the package for centos 6Parthenos
L
8

On Mac Os, this worked for me:

brew install gettext
brew link gettext --force
Laudian answered 24/10, 2019 at 11:30 Comment(0)
L
4
make -i
make -i install

..worked flawlessy for this problem. Also if anyone's having trouble with http/https helper, during configure do not forget to add the following thing

./configure --with-curl --with-expat
Liverwurst answered 27/12, 2012 at 12:40 Comment(2)
It should be noted that "-i" is short for "--ignore-errors", so any other error will be ignored too and may be overlooked because of the many gettext-related errors. So -i should be the last resort if nothing else works.Nide
@Nide Yes, it's a wrong work-around, but not everyone's a hacker. You obviously need gettext lib for the error to go.Liverwurst
G
4

On cygwin, you need to install the gettext-devel package as well. The gettext package alone is not enough to resolve this problem.

Gigahertz answered 13/2, 2014 at 16:53 Comment(0)
T
2

You can install gettext in the same way you are installing git. By downloading, extracting, building and installing it to a given location in your home folder:

curl -O https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.1.tar.gz
tar xvf gettext-0.20.1.tar.gz
cd gettext-0.20.1/
./configure --prefix=/home/$HOME/opt
make
make install

Set the prefix to the location you want for the installation.

Twomey answered 27/5, 2019 at 14:24 Comment(0)
I
2

In Debian 10 to me was missing package gettext. Solved as follow:

$ sudo apt install gettext

Then make commando worked fine.

Isotropic answered 13/3, 2021 at 15:40 Comment(0)
M
1

xgettext, msgfmt and etc. belong to GNU gettext toolset. On macOS, you could use MacPort's port command to install these tools on your system:

port install gettext
Mercury answered 7/6, 2019 at 6:19 Comment(0)
G
0

There's one more option to obtain the software:

ipkg install gettext
Geanticline answered 29/1, 2022 at 19:18 Comment(0)
C
-1

Try to add -i to your make command.

> make -i ...

Coalfield answered 15/11, 2012 at 12:44 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.