Git > dyld: lazy symbol binding failed: Symbol not found: _iconv_open
Asked Answered
T

3

5

I don't know what happened but suddenly all my git commands won't work no more, this is the error message I get.

$ git show
dyld: lazy symbol binding failed: Symbol not found: _iconv_open
   Referenced from: /usr/local/bin/git
   Expected in: /Applications/MAMP/Library/lib//libiconv.2.dylib

dyld: Symbol not found: _iconv_open
   Referenced from: /usr/local/bin/git
   Expected in: /Applications/MAMP/Library/lib//libiconv.2.dylib

Any help is appreciated, thanks!

Additional info: When I check the libiconv.2.dylib file it gives me this output:

$ file /usr/lib/libiconv.2.dylib 
/usr/lib/libiconv.2.dylib: Mach-O universal binary with 2 architectures
/usr/lib/libiconv.2.dylib (for architecture i386):  Mach-O dynamically linked shared       library i386   
/usr/lib/libiconv.2.dylib (for architecture x86_64):    Mach-O 64-bit dynamically linked shared library x86_64

Which I understand should be 3 architectures, How would I add the third one?

EDIT: these are the links inside /Applications/MAMP/Library/lib/

-rwxrwxr-x   1 mm  admin     1194 Jan 22 10:52 libgettextsrc.la
-rwxrwxr-x   1 nm  admin  2241972 Jan 22 11:00 libiconv.2.dylib
lrwxr-xr-x   1 nm  admin       16 Mar  1 10:06 libiconv.dylib -> libiconv.2.dylib
Text answered 28/3, 2013 at 9:44 Comment(7)
OS X has dropped PPC support (even through emulation) for several major releases now, if that's the other architecture you're thinking might be needed.Systemic
From what I understand and have been reading about is I need 3 architectures, and from examples I can see it is -> /usr/lib/libiconv.2.dylib (for architecture ppc7400): Mach-O dynamically linked shared library ppc that I'm missing.Text
Could there be another reason for this error then? not a missing Architecture?Text
Not that I can think of at the moment, sorry.Hopefully someone else will have seen this one before.Systemic
Uh, /Applications/MAMP/Library/lib//libiconv.2.dylib... why is git pulling the library from there? Is that symlinked to /usr/lib/libiconv.2.dylib? Do you have an LD_LIBRARY_PATH set? What does otool -L /usr/local/bin/git say?Gen
It says command not found to otool, However in the folder /Applications/MAMP/Library/lib/ I find the following, see my post for the info ^Text
https://mcmap.net/q/451276/-git-error-dyld-lazy-symbol-binding-failed-symbol-not-found-_iconv_open fixed this problem for me (by creating a .bash_profile).Ginoginsberg
T
2

Finally figured it out, I had DYLD_LIBRARY_PATH enabled in my .bash_profile, the path was set to the mamp folder, so that git checks there first for the library.

Text answered 28/3, 2013 at 14:50 Comment(1)
Hi @Sam I have the same problem and need the DYLD_LIBRARY_PATH there in my .bash_profile, what should i do to get rid of the error?Thirst
S
6

I also had DYLD_LIBRARY_PATH set to my XAMPP location. I managed to fix it by also adding usr/lib back to DYLD-DYLD_LIBRARY_PATH in the .bash_profile

export DYLD_LIBRARY_PATH=/usr/lib/:$DYLD_LIBRARY_PATH
Stickler answered 21/5, 2014 at 14:0 Comment(0)
T
2

Finally figured it out, I had DYLD_LIBRARY_PATH enabled in my .bash_profile, the path was set to the mamp folder, so that git checks there first for the library.

Text answered 28/3, 2013 at 14:50 Comment(1)
Hi @Sam I have the same problem and need the DYLD_LIBRARY_PATH there in my .bash_profile, what should i do to get rid of the error?Thirst
D
1

I had a similar problem where git wouldn't work and I got this same error. I was running Mountain Lion. I decided to run all my updates to see if that would help anything. (Mavericks was a free upgrade, so I did that.) After completing my OS updates, I tried git again and got a message "xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download command line developer tools." I selected download in the dialog box, install the xcode tools and tried it again and it worked like a charm!

Defant answered 8/8, 2014 at 17:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.