Error in GIT with Mac OS X: dyld: lazy symbol binding failed: Symbol not found: _iconv_open

3

I'm trying to use the GIT through the terminal ( Mac OS X ), but the following error is appearing:

$ git help
dyld: lazy symbol binding failed: Symbol not found: _iconv_open
  Referenced from: /Library/Developer/CommandLineTools/usr/bin/git
  Expected in: /Library/PostgreSQL/9.3/lib/libiconv.2.dylib

dyld: Symbol not found: _iconv_open
  Referenced from: /Library/Developer/CommandLineTools/usr/bin/git
  Expected in: /Library/PostgreSQL/9.3/lib/libiconv.2.dylib

I have reinstalled command line tools and the error still persists when I use some command git

In my .bashrc I'm using the following path ...:

export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib

... because I am using virtualenv and the virtual environment was not able to identify postgresql, I already commented this line and rebooted the machine and still the same error continues. Although some solutions on the internet, I did not find one that solved my question.

    
asked by anonymous 04.08.2014 / 00:15

2 answers

1

I solved the problem, I discovered that in addition to the file .bashrc there was the file .profile with export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib , I commented this line and the problem was solved.

Note: In order to use DYLD to run postgresql, I created a fallback in '.profile':

export DYLD_FALLBACK_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib:$DYLD_LIBRARY_PATH

With this the default path export DYLD_LIBRARY_PATH=/usr/lib works (which does not pose a problem in GIT) and at the same time you can use postgresql without any problems.

    
04.08.2014 / 01:15
2

Try to point the variable to a real library path of iconv on your system.

Assuming that your system has a version of the library in /usr/lib (in my OS X Mavericks it is there, but I have installed a lot of extra things in it, so I can not confirm if this is standard):

export DYLD_LIBRARY_PATH=/usr/lib

In addition, this answer from SOen (and comment at Chris.Zou ) suggest adding the executable location of iconv to the start of PATH as well. Assuming you are using the version of Git installed next to XCode, the path /usr/bin already has high priority, but in installations by brew this can solve.

export PATH=/usr/local/bin:$PATH

And according to the comment, for installations through the Git website this may help:

export PATH=/usr/local/git/bin:$PATH
    
04.08.2014 / 01:21