通过Homebrew编译Git时出现问题
错误:执行失败:make prefix = / usr / local / Cellar / git / 1.7.6 install
我已删除并重新安装Homebrew并重新安装Xcode 3.2.6
系统: Mac OS X 10.6.8
任何想法是怎么回事?
更新:
这是错误跟踪的尾部。不确定在哪里看。希望这会有所帮助。
referenced from :
" _libiconv", referenced _reencode_stringfrom:
_reencode_stringin libgit.a(inutf8.o )libgit.a
( utf8.o )"
_libiconv_close " ," _libiconv_close", referencedreferenced from _reencode_string infrom:
:
libgit.a_reencode_string( in utf8.o libgit.a_reencode_string( utf8.oin)
libgit.a ()utf8.o)
" _libiconv_close " ,
referenced _reencode_string from:in
libgit.a( _reencode_string utf8.o )
ld in : _reencode_string symbol(s) not found
in libgit.a(utf8.o)
ld: symbol(slibgit.a) not( utf8.o)
found
_reencode_string in libgit.a(utf8.o)
ld: symbol(s) not found
collect2: collect2: Undefinedld returned 1 exit status
symbols:
"ld returned 1 exit status_libiconv_open"
, referenced from:
_reencode_string in libgit.a(utf8.o)
"_libiconvcollect2: ", referencedld returned 1 exit status
from:
_reencode_string in libgit.a(utf8.o)
"_libiconv_close", referenced from:
_reencode_string in libgit.a(utf8.o)
_reencode_string in libgit.a(utf8.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [git-daemon] Error 1
make: *** Waiting for unfinished jobs....
make: *** [git-fast-import] Error 1
make: *** [git-imap-send] Error 1
make: *** [git-shell] Error 1
==> Exit Status: 2
http://github.com/mxcl/homebrew/blob/master/Library/Formula/git.rb#L37
==> Environment
HOMEBREW_VERSION: 0.8
HEAD: 63da621a3fb430cb9ae757a09077890be8aa689e
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: quad-core 64-bit arrandale
OS X: 10.6.8
Kernel Architecture: i386
Ruby: 1.8.7-174
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 3.2.6
GCC-4.0: build 5494
GCC-4.2: build 5666
LLVM: build 2335
MacPorts or Fink? false
X11 installed? true
==> Build Flags
CC: /usr/bin/cc => /usr/bin/gcc-4.2
CXX: /usr/bin/c++ => /usr/bin/c++-4.2
LD: /usr/bin/cc => /usr/bin/gcc-4.2
CFLAGS: -O3 -w -pipe
CXXFLAGS: -O3 -w -pipe
MAKEFLAGS: -j4
不确定是否值得注意,但跟踪显示的是Ruby 1.8
虽然ruby -v
给出了红宝石1.9.2p180
好的,我已经更新了错误跟踪。
答案 0 :(得分:0)
如果您没有安装所需的库依赖项,或者由于某种原因从编译行中缺少对象文件或包含目标文件,则会发生ld: symbol(s) not found
。如果不知道找不到什么符号,就无法进一步提供帮助。你切断了错误信息的好处。这就像到了一本神秘小说的最后一章并发现它被撕掉了: - )
答案 1 :(得分:0)
我通过将lib
中的include
和/usr/local
目录重命名为lib_old
和include_old
,然后运行brew install git
来解决此问题。不幸的是,这可能会破坏依赖于那些目录的其他代码...
通过此讨论:https://github.com/mxcl/homebrew/issues/1948#issuecomment-326283