2012-07-06 214 views
36

試圖做一個化妝從源代碼安裝的git的,它保持踢了錯誤:什麼是libintl.h,我在哪裏可以得到它?

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 

谷歌搜索沒有量已經變成任何東西上lib.intl.h.什麼是這個難以捉摸的庫,我怎麼能得到它,所以我最終可以安裝git?

+0

http://mhs.stiki.ac.id/sym/root/usr/local/include/ – 2012-07-06 23:10:32

+0

@SeeBeen:具有'libintl.h副本'頭文件沒有用處;你需要與之配合的圖書館。 – 2012-07-06 23:31:01

+0

@凱思湯普森 我認爲所有必要的文件都在該文件夾中。 我的一個朋友有相同的概率。最近。他在ubuntu tho上:/ – 2012-07-06 23:33:49

回答

27

根據系統,它可能是GNU C庫(glibc)的一部分。

請注意,只是安裝文件libintl.h是不可能對你有任何好處。

在基於Debian的系統(包括Debian的,Ubuntu和Linux Mint的),它是libc6-dev包的一部分,安裝:

sudo apt-get install libc6-dev 

由於您使用的是Mac OS X,谷歌搜索「libintl.h OSX」顯示了很多有類似問題的人。按照INSTALL文件中的Git源:

Set NO_GETTEXT to disable localization support and make Git only use English. Under autoconf the configure script will do this automatically if it can't find libintl on the system.

+8

有趣的是,當我搜索'osx libintl.h'時,這是我得到的第一個結果。 – Michael 2014-01-23 18:42:40

+11

如果你使用的是OS X,你可以像這樣調用make來設置NO_GETTEXT:NO_GETTEXT = 1 make。我認爲在Bash中所有帶有環境變量的命令都是如此,對吧? – 2014-05-29 01:58:20

+1

@Cupcake:是的,但'configure'腳本應該自動執行,所以你不必擔心它。 – 2014-05-29 02:08:10

1

如果你能找到Libtools的正確版本(從http://ftp.gnu.org/gnu/libtool/),你可能會發現它在包..

否則,你可以使用下面的配置爲消除這種依賴關係:

./configure --disable-nls 
6

當軟件包正在查找此文件時,請安裝或構建GNU gettext軟件包。這包「安裝」 ${prefix}/include/libintl.h,除其他事項外

+6

由於OP在OS X上,可能有幫助,但並未指定他是否使用Homebrew:我已經看到,儘管安裝了gettext,一些構建仍然無法找到libintl - I不得不'釀造鏈接gettext'來解決它。 – ches 2012-10-31 12:32:12

+0

上面的提示醞釀鏈接gettext爲我嘗試編譯我的Mac上的Phalcon PHP時工作。謝謝你的提示! – user1493194 2014-06-11 17:38:17

+0

根據[GNU編碼標準](https://www.gnu.org/prep/standards/standards.html),'$ {prefix}/include/libintl.h'爲'$ {includedir}/libintl。 h'。 – jww 2018-02-05 22:01:00

2

如果你不關心的本地化,並確定只用英語,定義在Makefile

NO_GETTEXTMakefile

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.

+1

如果你使用的是OS X,你可以像這樣調用make來設置NO_GETTEXT:NO_GETTEXT = 1 make。我認爲在Bash中所有帶有環境變量的命令都是如此,對吧? – 2014-05-29 01:58:41

+0

make prefix =/usr NO_GETTEXT = 1; sudo make prefix =/usr install NO_GETTEXT = 1 – UnchartedWorks 2014-12-17 17:42:11

2

在爲了在OSX Lion上安裝最新版本的git,我這樣做了:

*請注意,如果你沒有安裝git,你可以直接從t下載它他網站並將其解壓到~/src/git

我還建議您做一個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 

通過做這種方式我沒有下載任何額外的庫或做在論壇上尋找答案的任何狩獵。感謝automake,我知道git是爲我的系統設置的,並且運行時沒有任何打嗝。

22

我瞭解到libintl來自libgettext。如果你已經安裝了自制的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..> 

和我對問題的以下作品「庫沒有發現-lintl」

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

謝謝,這個修正了「ld:library not-for -lintl」的錯誤,我得到了! – tukushan 2014-01-22 12:43:52

+0

我仍然在使用'gcc -g -O2 -DCHROMA_CURSES_HEADER = \ -DCHROMA_DATA_DIR = \「/ usr/local/share/chroma/\」-c -o main.o main.c main.c:33: 10:致命錯誤:找不到'libintl.h'文件。我如何確定gcc正在查找文件的正確位置? – mareoraft 2015-12-21 20:11:08

1

安裝macport和類型上的終端

sudo port install libcxx 
0

如果你想編譯AssaultCube並收到此錯誤(應該抱怨「INTL/libintl.h」被失蹤),你必須採取INTL.framework從AssaultCube應用程序和內容把它放在/ Library/Frameworks中。 MacPorts,HomeBrew等沒有軟件包可以解決它。非常非常討厭有多少開源項目無法編譯。

16

FWIW在OSX與埃爾卡皮坦和自制軟件,我做了:

1)我不知道,如果埃爾卡皮坦升級打破了東西,所以首先我確信我有最新的gettext:

$ brew reinstall gettext 

然後我不得不做重新鏈接:

$ brew unlink gettext && brew link gettext --force 

之後,其他工具都可以找到它,生活又恢復正常。

+7

更好的是讓brew爲您處理鏈接細節:​​'brew unlink gettext && brew link gettext --force' – 2015-11-26 14:57:25

+0

這個anwser幫助我很多 – zhaozhi 2016-09-12 06:32:01

+0

這對我沒有用。通過brew重新安裝gettext來與警告「這個公式是桶只,這意味着它沒有符號鏈接到/ usr/local」。既不像你所建議的那樣手動鏈接,也不能像brew @AmartheaMagnuson建議的那樣通過鏈接來獲取git來編譯鏈接。仍然有錯誤「gettext.h:17:11:致命錯誤:找不到'libintl.h'文件」。 :( – ziggurism 2016-12-13 18:20:55

0

What is this elusive library, and how can I get it so I can finally install git?

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 functions gettext , dgettext , dcgettext , ngettext , dngettext , dcngettext , textdomain , bindtextdomain , bind_textdomain_codeset .

Documentation:

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.

您可以從Gnulib,這是The GNU Portability Library得到libintl.h。它可以從GNU的Savannah下載。

Gnulib web page還指出:

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.

相關問題