git 什么是 libintl.h,我在哪里可以得到它?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11370684/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 14:05:21  来源:igfitidea点击:

What is libintl.h and where can I get it?

gitosx-lion

提问by Adam Templeton

Trying to do a make install of git from source, and it keep kicking up the error:

尝试从源代码进行 git 的 make install,但它不断引发错误:

 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?

没有多少谷歌搜索在 lib.intl.h 上找到任何东西。这个难以捉摸的库是什么,我怎样才能得到它以便我最终可以安装 git?

采纳答案by Keith Thompson

Depending on the system, it's probably part of the GNU C library (glibc).

根据系统,它可能是 GNU C 库 (glibc) 的一部分。

Note that just installing the file libintl.hisn't likely to do you any good.

请注意,仅安装该文件libintl.h不太可能对您有任何好处。

On Debian-based systems (including Debian, Ubuntu, and Linux Mint), it's part of the libc6-devpackage, installed with:

在基于 Debian 的系统(包括 Debian、Ubuntu 和 Linux Mint)上,它是libc6-dev软件包的一部分,安装有:

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 INSTALLfile in the Git sources:

由于您使用的是 Mac OS X,因此在 Google 上搜索“libintl.h OSX”会发现很多人都遇到了类似的问题。根据INSTALLGit 来源中的文件:

Set NO_GETTEXTto disable localization support and make Git only use English. Under autoconfthe configurescript will do this automatically if it can't find libintlon the system.

设置NO_GETTEXT为禁用本地化支持并使 Git 仅使用英语。根据autoconfconfigure脚本会自动执行此操作,如果它无法找到libintl的系统。

回答by rotten

FWIW on OSX with El Capitan and homebrew, I did a:

FWIW 在 OSX 上使用 El Capitan 和自制软件,我做了一个:

1) I wasn't sure if the El Capitan upgrade had broken something, so first I made sure I had the latest gettext:

1) 我不确定 El Capitan 升级是否破坏了某些东西,所以首先我确保我有最新的 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.

之后,其他工具都能找到它,生活又恢复了正常。

回答by ronnefeldt

I learned libintl comes from libgettext. If you already installed gettext by Homebrew, you would see:

我了解到 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..>

and the following works for me on the issue of "library not found for -lintl"

以下是关于“未找到 -lintl 的库”问题的内容

ln -s /usr/local/Cellar/gettext/0.18.3.2/lib/libintl.* /usr/local/lib/

回答by Michael Felt

When packages are looking for this file, install or build the GNU gettext package. This packages "installs" ${prefix}/include/libintl.h, among other things

当包正在寻找这个文件时,安装或构建 GNU gettext 包。这个包“安装” ${prefix}/include/libintl.h,除此之外

回答by AvkashChauhan

If you can find the proper version of Libtools (from http://ftp.gnu.org/gnu/libtool/) you might find it in the package..

如果您能找到正确版本的 Libtools(来自http://ftp.gnu.org/gnu/libtool/),您可能会在包中找到它。

Otherwise you can use below to the configure to remove this dependency:

否则,您可以使用下面的配置来删除此依赖项:

./configure --disable-nls

回答by blindMoe

In order to install the newest version of git on OSX Lion this is what I did:

为了在 OSX Lion 上安装最新版本的 git,我是这样做的:

*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

*请注意,如果您还没有安装 git,您可以从站点下载并解压到 ~/src/git

I also recommend doing a whereis gitto see if you already have it installed so you know what to set your prefix to. Mine was /usr/bin/gitso I set my prefix to just /usr

我还建议你做一个whereis git看看你是否已经安装了它,这样你就知道将前缀设置为什么。我的/usr/bin/git所以我将前缀设置为/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.

通过这样做,我不必下载任何额外的库或在论坛上寻找答案。感谢 automake,我知道 git 是为我的系统设置的,并且可以毫无问题地运行。

回答by ljs

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.

这看起来很有希望 - http://code.google.com/p/rudix/downloads/detail?name=static-libintl-0.18.1.1-5.pkg&can=2&q=- 似乎包含 libintl 作为 pkg。它为我解决了对 libintl 的依赖。

回答by manojlds

If you don't care about localization and are ok with just English, define NO_GETTEXTin the Makefile

如果您不关心本地化并且只使用英语就可以NO_GETTEXT,请在Makefile

From the Makefile:

来自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.

如果您不想翻译 Git 输出,请定义 NO_GETTEXT。翻译的 Git 需要 GNU libintl 或其他 gettext 实现,以及运行时的 libintl-perl。

回答by Jorge Miguel

install macport and type on terminal

安装macport并在终端上输入

sudo port install libcxx

回答by sudo

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.

如果您尝试编译 AssaultCube 并遇到此错误(应该抱怨“INTL/libintl.h”丢失),则必须从 AssaultCube 应用程序内容中获取 INTL.framework 并将其放入 /Library/Frameworks。MacPorts、HomeBrew 等的任何软件包都无法修复它。非常非常烦人,有多少开源项目无法编译。