试图从源代码安装git,它会继续引发错误:
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
Run Code Online (Sandbox Code Playgroud)
在lib.intl.h上没有任何谷歌搜索结果.什么是这个难以捉摸的库,我怎样才能得到它以便我最终可以安装git?
Kei*_*son 34
根据系统的不同,它可能是GNU C库(glibc)的一部分.
请注意,只安装文件libintl.h不太可能对您有所帮助.
在基于Debian的系统(包括Debian,Ubuntu和Linux Mint)上,它是libc6-dev软件包的一部分,安装有:
sudo apt-get install libc6-dev
Run Code Online (Sandbox Code Playgroud)
由于您使用的是Mac OS X,因此Google搜索"libintl.h OSX"会显示许多人遇到类似问题.根据INSTALLGit中的文件来源:
设置
NO_GETTEXT为禁用本地化支持并使Git仅使用英语.根据autoconf该configure脚本会自动执行此操作,如果它无法找到libintl系统.
rot*_*ten 31
在使用El Capitan和自制软件的OSX上的FWIW,我做了一个:
1)我不确定El Capitan升级是否破坏了某些东西,所以首先我确定我有最新的gettext:
$ brew reinstall gettext
Run Code Online (Sandbox Code Playgroud)
然后我不得不通过这样做重新链接:
$ brew unlink gettext && brew link gettext --force
Run Code Online (Sandbox Code Playgroud)
在那之后,其他工具能够找到它,生活恢复正常.
ron*_*ldt 24
我学会了libintl来自libgettext.如果你已经通过Homebrew安装了gettext,你会看到:
$ 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..>
Run Code Online (Sandbox Code Playgroud)
以下是关于"找不到-lintl的库"问题的以下工作
ln -s /usr/local/Cellar/gettext/0.18.3.2/lib/libintl.* /usr/local/lib/
Run Code Online (Sandbox Code Playgroud)
小智 7
当包正在寻找此文件时,安装或构建GNU gettext包.${prefix}/include/libintl.h除其他外,这个包"安装"
小智 7
对于那些试图从 2021 年 5 月开始在 macOS 上构建 Git 并希望国际化的人,我发现这是最好的非破坏性解决方案:
brew install gettext
Run Code Online (Sandbox Code Playgroud)
找到 libintl 标头和库的位置:
find /opt -name "libintl.*" -print
/opt/homebrew/include/libintl.h
/opt/homebrew/lib/libintl.dylib
/opt/homebrew/lib/libintl.8.dylib
/opt/homebrew/lib/libintl.a
/opt/homebrew/Cellar/gettext/0.21/include/libintl.h
/opt/homebrew/Cellar/gettext/0.21/lib/libintl.dylib
/opt/homebrew/Cellar/gettext/0.21/lib/libintl.8.dylib
/opt/homebrew/Cellar/gettext/0.21/lib/libintl.a
Run Code Online (Sandbox Code Playgroud)
请注意 gettext 目录的位置。
现在运行以下命令(如果您的 CFLAGS 和 LDFLAGS 已设置,则可能会略有不同。只需确保 gettext 路径包含在已存在的其他路径中):
make configure
./configure "LDFLAGS=$LDFLAGS -L/opt/homebrew/Cellar/gettext/0.21/lib" \
"CFLAGS=-I/opt/homebrew/Cellar/gettext/0.21/include"
Run Code Online (Sandbox Code Playgroud)
正确配置后,您应该能够使用make.
如果可以找到正确版本的Libtools(来自http://ftp.gnu.org/gnu/libtool/),则可以在软件包中找到它。
否则,您可以使用以下配置删除此依赖项:
./configure --disable-nls
Run Code Online (Sandbox Code Playgroud)