Git > dyld:懒惰的符号绑定失败:找不到符号:_iconv_open

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15678546/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 08:23:01  来源:igfitidea点击:

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

macosgitmamplibiconv

提问by Samuel

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 命令都无法工作了,这是我收到的错误消息。

$ 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:

附加信息:当我检查 libiconv.2.dylib 文件时,它给了我这个输出:

$ 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?

我理解应该是 3 个架构,我将如何添加第三个?

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

编辑:这些是里面的链接/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

采纳答案by Samuel

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

终于弄明白了,我DYLD_LIBRARY_PATH在我的 .bash_profile 中启用了,路径被设置为 mamp 文件夹,所以 git 首先检查那里的库。

回答by flunder

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

我还将 DYLD_LIBRARY_PATH 设置为我的 XAMPP 位置。我设法通过将 usr/lib 添加回 .bash_profile 中的 DYLD-DYLD_LIBRARY_PATH 来修复它

export DYLD_LIBRARY_PATH=/usr/lib/:$DYLD_LIBRARY_PATH

回答by fastone

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!

我有一个类似的问题,其中 git 不起作用,我遇到了同样的错误。我在跑山狮。我决定运行我的所有更新,看看这是否有帮助。(Mavericks 是免费升级,所以我这样做了。)完成操作系统更新后,我再次尝试 git 并收到一条消息“xcode-select:注意:在‘/Applications/Xcode.app’中找不到开发人员工具,请求安装。在对话框中选择一个选项以下载命令行开发人员工具。” 我在对话框中选择了下载,安装了 xcode 工具并再次尝试,它就像一个魅力!