git + 山狮 + dyld:懒惰的符号绑定失败:找不到符号:___strlcpy_chk
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22920497/
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
git + mountain lion + dyld: lazy symbol binding failed: Symbol not found: ___strlcpy_chk
提问by oana
- os: mac os 10.8.3
- xcode: 4.6.3 w command line tools installed
- /usr/local/bin/git -> /usr/local/git/bin/git
- 操作系统:Mac 操作系统 10.8.3
- xcode: 4.6.3 w 安装了命令行工具
- /usr/local/bin/git -> /usr/local/git/bin/git
any ideas how to fix?
任何想法如何解决?
(the discussion threads i was able to find on the topic mentioned a) installing the command line tools and b) making sure that /usr/local/bin was included in the PATH, both of which i seem to have done here.)
(我能够在提到的主题上找到的讨论线程 a)安装命令行工具和 b)确保 /usr/local/bin 包含在 PATH 中,这两个我似乎都在这里完成了。)
thank you in advance.
先感谢您。
git init
dyld: lazy symbol binding failed: Symbol not found: ___strlcpy_chk
Referenced from: /usr/local/bin/git
Expected in: /usr/lib/libSystem.B.dylib
回答by Robin Liu
I came up with this issue because I installed git-2.2.1-intel-universal-mavericks.dmg
, actually mavericks(10.9.x)
is latter version than mountain lion(10.8.x)
, and snow-leopard is earlier than mountain lion, after I installed git-2.2.1-intel-universal-snow-leopard
, this issue had gone.
出现这个问题是因为我安装了git-2.2.1-intel-universal-mavericks.dmg
,其实mavericks(10.9.x)
是后版本mountain lion(10.8.x)
,而snow-leopard比山狮早,我安装后 git-2.2.1-intel-universal-snow-leopard
,这个问题就没有了。
回答by Thanu
I had the exact same issue and this is how I fixed it,
我遇到了完全相同的问题,这就是我解决它的方法,
Followed this article to install command line toolsfor xCode(I got xCode 5.1).
按照这篇文章为 xCode安装命令行工具(我得到了 xCode 5.1)。
Then also edited my .bash_profile
然后还编辑了我的 .bash_profile
$vi ~/.bash_profile
export PATH=$PATH:/usr/local/git/bin/
Even after doing these 2 things, I was getting the same error with git command line. But then I had Restartmy computer to it to work.
即使在做了这两件事之后,我在使用 git 命令行时也遇到了同样的错误。但是后来我重新启动了我的电脑才能工作。
Hope this will help.
希望这会有所帮助。
回答by Cronk
Oana, I was also having troubles with the same error message you quoted. I tried the PATH trick (didn't help). I wasn't really interested in installing Xcode and then the 'Command Line Tools' as others had suggested. But I did stumble upon half an answer.
Oana,我也遇到了您引用的相同错误消息的麻烦。我尝试了 PATH 技巧(没有帮助)。我对安装 Xcode 和其他人建议的“命令行工具”并不真正感兴趣。但我确实偶然发现了一半的答案。
First, I uninstalled my current version of Git (1.9.2). I then found that it is possible to install the Command Line Tools by themselves, without installing Xcode:
首先,我卸载了当前版本的 Git (1.9.2)。然后我发现可以自己安装命令行工具,而无需安装Xcode:
Xcode page: https://developer.apple.com/xcode/->
Downloads near the top ->
Scroll down to 'Additional Tools'->'
View Downloads'-> Command Line Tools (OS X Mountain Lion)
Xcode 页面:https: //developer.apple.com/xcode/->
顶部附近的下载 ->
向下滚动到“其他工具”->“
查看下载 -> 命令行工具 (OS X Mountain Lion)
With those installed, doing 'git --version' returned this:
安装后,执行 'git --version' 返回:
git version 1.8.5.2 (Apple Git-48)
The file "/usr/lib/libSystem.B.dylib" was untouched during this process. Or at least, the file size and date did not change.
在此过程中,文件“/usr/lib/libSystem.B.dylib”未受影响。或者至少,文件大小和日期没有改变。
It is my guess that the issue was created in a more recent version of git, one that is checking for the symbol in question, whereas the older versions don't check for it. I thought about testing that theory and found the older source code for various versions of Git, but didn't have time to spend compiling/installing/testing each one to see if this theory is correct. And I didn't see a simple method of uninstalling the 'command line tools'. Maybe someone else is more intrepid. :)
我猜测这个问题是在更新版本的 git 中创建的,一个正在检查有问题的符号,而旧版本不检查它。我想测试这个理论并找到了各种版本的 Git 的旧源代码,但没有时间花时间编译/安装/测试每个版本来看看这个理论是否正确。而且我没有看到卸载“命令行工具”的简单方法。也许别人更勇敢。:)
-- J
——J
回答by Airhogs777
If you're using SourceTree, it comes with its own version of git and the above solutions won't work. You have to go to Preferences>Git and change the setting from Embedded git
to System git
如果您使用的是 SourceTree,它带有自己的 git 版本,上述解决方案将不起作用。您必须转到首选项> Git 并将设置从 更改Embedded git
为System git
(I struggled with this for about a day before I figured this out, hopefully it'll save someone the trouble)
(在我弄清楚这一点之前,我为此挣扎了大约一天,希望它可以为某人省去麻烦)