问题
Trying to do a make install of git from source, and it keep kicking up the error:
make install
* new build flags or prefix
CC credential-store.o
In file included from credential-store.c:1:
In file included from ./cache.h:8:
./gettext.h:17:11: fatal error: 'libintl.h' file not found
# include <libintl.h>
^
1 error generated.
make: *** [credential-store.o] Error 1
No amount of Googling has turned up anything on lib.intl.h. What is this elusive library, and how can I get it so I can finally install git?
回答1:
Depending on the system, it's probably part of the GNU C library (glibc).
Note that just installing the file libintl.h
isn't likely to do you any good.
On Debian-based systems (including Debian, Ubuntu, and Linux Mint), it's part of the libc6-dev
package, installed with:
sudo apt-get install libc6-dev
Since you're using Mac OS X, a Google search for "libintl.h OSX" shows a lot of people having similar problems. According to the INSTALL
file in the Git sources:
Set
NO_GETTEXT
to disable localization support and make Git only use English. Underautoconf
theconfigure
script will do this automatically if it can't findlibintl
on the system.
回答2:
FWIW on OSX with El Capitan and homebrew, I did a:
1) I wasn't sure if the El Capitan upgrade had broken something, so first I made sure I had the latest gettext:
$ brew reinstall gettext
Then I had to re-link by doing:
$ brew unlink gettext && brew link gettext --force
After that, other tools were able to find it, and life went back to normal.
回答3:
I learned libintl comes from libgettext. If you already installed gettext by Homebrew, you would see:
$ locate libintl
/usr/local/Cellar/gettext/0.18.3.2/lib/libintl.8.dylib
/usr/local/Cellar/gettext/0.18.3.2/lib/libintl.a
/usr/local/Cellar/gettext/0.18.3.2/lib/libintl.dylib
<..snip..>
and the following works for me on the issue of "library not found for -lintl"
ln -s /usr/local/Cellar/gettext/0.18.3.2/lib/libintl.* /usr/local/lib/
回答4:
When packages are looking for this file, install or build the GNU gettext package. This packages "installs" ${prefix}/include/libintl.h
, among other things
回答5:
If you can find the proper version of Libtools (from http://ftp.gnu.org/gnu/libtool/) you might find it in the package..
Otherwise you can use below to the configure to remove this dependency:
./configure --disable-nls
回答6:
In order to install the newest version of git on OSX Lion this is what I did:
*Note that if you do not have git already installed you can just download it from the site and unpack it in to ~/src/git
I also recommend doing a whereis git
to see if you already have it installed so you know what to set your prefix to. Mine was /usr/bin/git
so I set my prefix to just /usr
mkdir ~/src
git clone https://github.com/git/git.git
cd git
make configure
./configure --prefix=/usr
make
make install
By doing it this way I did not have to download any extra libraries or do any hunting on forums for answers. Thanks to automake I know that git is setup for my system and will run without any hiccups.
回答7:
This looks promising - http://code.google.com/p/rudix/downloads/detail?name=static-libintl-0.18.1.1-5.pkg&can=2&q= - appears to contain libintl as a pkg. It resolved a dependency on libintl for me.
回答8:
If you don't care about localization and are ok with just English, define NO_GETTEXT
in the Makefile
From the Makefile
:
Define NO_GETTEXT if you don't want Git output to be translated. A translated Git requires GNU libintl or another gettext implementation, plus libintl-perl at runtime.
回答9:
install macport and type on terminal
sudo port install libcxx
回答10:
If you're trying to compile AssaultCube and are getting this error (should complain about "INTL/libintl.h" being missing), you have to take INTL.framework from the AssaultCube app contents and put it in /Library/Frameworks. No packages from MacPorts, HomeBrew, etc. can fix it. Very very annoying how many open source projects fail to compile.
回答11:
What is this elusive library, and how can I get it so I can finally install git?
From the GNU manual:
11.21 libintl.h
Libintl is a library that provides native language support to programs.
Defines the macros
__USE_GNU_GETTEXT
,__GNU_GETTEXT_SUPPORTED_REVISION
, and declares the functionsgettext
,dgettext
,dcgettext
,ngettext
,dngettext
,dcngettext
,textdomain
,bindtextdomain
,bind_textdomain_codeset
.Documentation:
- http://www.gnu.org/software/libc/manual/html_node/Message-catalogs-with-gettext.html,
- http://www.gnu.org/software/gettext/manual/html_node/gettext.html.
Gnulib module: gettext
Portability problems fixed by Gnulib, if GNU gettext is installed:
This header file is missing on some platforms: Mac OS X 10.5, FreeBSD 6.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, mingw, MSVC 9, Interix 3.5, BeOS.
The functions cannot deal with GNU .mo files with system-dependent strings (of major version 1 or of minor version 1) on some non-glibc platforms: NetBSD 3.0, Solaris 10.
You can get libintl.h
from Gnulib, which is The GNU Portability Library. It is available for download from GNU's Savannah.
The Gnulib web page also states:
Gnulib does not make releases. It is intended to be used at the source level.
You can browse the current gnulib sources on Savannah.
To use Gnulib, you can retrieve its source code and its history via anonymous Git, using the following shell command:
git clone git://git.savannah.gnu.org/gnulib.git
Developers can also retrieve the source code via non-anonymous Git, for purposes of doing commits; for details, please see Gnulib's top-level README file.
After you have the sources, run ./gnulib-tool --help. For help and more info, see the documentation and other resources below.
来源:https://stackoverflow.com/questions/11370684/what-is-libintl-h-and-where-can-i-get-it