Skip to content

Loading…

git - Undefined symbols: "_libiconv_open", referenced from: _reencode_string in libgit.a(utf8.o) #894

Closed
the-kenny opened this Issue · 13 comments

6 participants

@the-kenny
moritz@Moritz-MacBook ~ % brew install git
==> make prefix=/homebrew/Cellar/git/1.7.0.1 install
GIT_VERSION = 1.7.0.1
    * new build flags or prefix
...Much build-stuff
    LINK git-fast-import
    LINK git-imap-send
Undefined symbols:
  "_libiconv_open", referenced from:
      _reencode_string in libgit.a(utf8.o)
  "_libiconv", referenced 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
Undefined symbols:
  "_libiconv_open", referenced from:
      _reencode_string in libgit.a(utf8.o)
  "_libiconv", referenced 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-imap-send] Error 1
make: *** Waiting for unfinished jobs....
make: *** [git-fast-import] Error 1
http://github.com/mxcl/homebrew/blob/master/Library/Formula/git.rb#L20
==> Environment
HOMEBREW_VERSION: 0.5
HEAD: 
HOMEBREW_PREFIX: /homebrew
HOMEBREW_CELLAR: /homebrew/Cellar
HOMEBREW_CACHE: /Users/moritz/Library/Caches/Homebrew
HOMEBREW_REPOSITORY: /homebrew
HOMEBREW_LIBRARY_PATH: /homebrew/Library/Homebrew
Hardware: dual-core 64-bit penryn
OS X: 10.6.2
Kernel Architecture: i386
Ruby: 1.8.7-72
GCC-4.2: build 5646 (5577 or newer recommended)
LLVM: build 2206 (2206 or newer recommended)
MacPorts or Fink? false
X11 installed? true
Exit status: 2
Error: Failure while executing: make prefix=/homebrew/Cellar/git/1.7.0.1 install
brew install git  63,70s user 11,26s system 158% cpu 47,186 total
1 moritz@Moritz-MacBook ~ %                                                  :( 
@tstevens

I have had this issue happen to me personally. I have not found a true fix but a workaround if your willing. That error is a conflict with another installed formula (not sure which one). I have gotten around this by moving all of the folders inside cellar to the trash or another folder temporarily, then retry installing git and then move the files back to the cellar afterwards. Its not a true fix but it will get git to build.

@adamv

tstevens: Can you gist a list of your installed formulas?

@tstevens

Here is my list of installed formulas:
http://gist.github.com/323307

I also verified build failure; uninstalled git and tried to install again and received above error. Build works on clean cellar.

Here is a gist of build failing and then succeeding after I moved everything in Cellar to temporary folder then tried build.

http://gist.github.com/323314

@mxcl
Homebrew member

the-kenny can you gist your installed formula?

@al3x

I get the same failure with the most current Git formula.

I moved the contents of /usr/local/Cellar to another directory, then tried brew install git again. Still got the same failure.

@the-kenny

Sorry for taking so long to respond; I found the problem some minutes after I posted this issue, and just forget about it.

The problem was a self-built version of libiconv in /usr/local, which for some reason wasn't built for x86_64. Deleting this version in /usr/local fixed everything.

@mxcl
Homebrew member

Cool. I think it is likely something deeper though as we've had quite a few dupe tickets for this since about Git 1.7.

al3x could you gist the build output? As I recently changed the Git formula to show verbose build output and that should help.

In the meantime if you really need a working git I recommend downgrading the formula to 1.6.2:

git reset ab7c4fa Library/Formula/git.rb
brew install git
@al3x

I ended up uninstalling everything I had installed. The current Git forumla then built just fine. Something else I had previously installed must have caused the iconv issue.

@webknows

Any of the proposed solutions here didn't work for me.
When I tried 'git reset' command, I received:
Unstaged changes after reset:
M Library/Formula/git.rb
Then tried to install git again, same iconv error.

Also, cleaning up Cellar didn't help (same error for a brand new git installation)

@mxcl
Homebrew member

Sorry you should do a --hard reset.

@mxcl
Homebrew member

We'll close this when we have the checks from brew doctor committed.

@adamv

Should brew doctor check for "/opt/lib/libiconv.*.dylib" or something?

@adamv

"brew doctor" is in place, and we can add more checks there if "find stray dylibs" isn't enough. Closing this issue.

@joshua-rutherford joshua-rutherford pushed a commit to joshua-rutherford/homebrew that referenced this issue
@DomT4 DomT4 node010 0.10.40
Closes #894.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
ae77e23
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.