Reputation: 1649
I am using the command git clone ssh://.... and getting the following error on the terminal:
dyld: lazy symbol binding failed: Symbol not found: ___strlcpy_chk
Referenced from: /usr/local/git/bin/git
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: ___strlcpy_chk
Referenced from: /usr/local/git/bin/git
Expected in: /usr/lib/libSystem.B.dylib
Trace/BPT trap: 5
Upvotes: 35
Views: 51054
Reputation: 1026
I was also plagued with git causing the dreaded:
dyld: lazy symbol binding failed: Symbol not found: ___strlcpy_chk
Referenced from: /usr/local/bin/git
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: ___strlcpy_chk
Referenced from: /usr/local/bin/git
Expected in: /usr/lib/libSystem.B.dylib
After reading many successfully executed suggestions revolving around updating xCode (>2G) or just the Command Line Tools part of xCode (~200M) I installed the Command Line Tools and this fixed my problem when using git from the command line.
Interestingly, I was having trouble with PyCharm getting the same error, even after I did the update. I was able to fix this by changing the path where git was found (In PyCharm->Preferences...->Version Control->Git, I changed /usr/local/bin/git to /usr/bin/git near the top):
Image of PyCharm->Preferences...->Version Control->Git
I finally figured out exactly what’s going on -- and to pay homage to all the help I received from the web, want to share the specifics:
I discovered there were two versions of git installed on my machine:
/usr/bin/git
/usr/local/git/bin/git
(also interestingly: /usr/local/bin/git -> ../git/bin/git)
Some suggestions for putting /usr/bin in the path are somewhat helpful, but might not solve the niggling problem that there’s a version of git installed that doesn’t work.
So note this:
$ pwd
/usr/local/git/bin
$./git --version
git version 2.8.1
And:
$ pwd
/usr/bin
$ ./git --version
git version 1.8.5.2 (Apple Git-48)
The Apple git version is the one that works -- this is the one likely installed by installing the Command Line Tools from xCode. Note the paths in each. Also note that you don't necessarily have to install the whole Command Line Tools, just a proper version of git.
Further, in the /usr/local/git/bin/ directory, there’s an uninstall.sh script. In that script, it uses pkgutil to uninstall the version of git. (You should use this script to do the uninstall.) You can run this line to verify that this utility has record of installing git:
pkgutil --packages | grep com.git.pkg
This is not the version you want. You want the Apple version. Use the script in the /usr/local/git/bin to uninstall the broken version of git.
Uninstalling it assures you will never get this error, and that you will be using the proper version of git.
Hope that helps some others. The info was good but incomplete. And there was almost nothing for PyCharm.
Upvotes: 2
Reputation: 231
Had the same problem. I have OS X 10.8, so XCode was not a solution for me.
Turns out I had a Git version that's not compatible with my OS X version
This info might help(found it googling :) ):
If you are running:
You can download from here: http://sourceforge.net/projects/git-osx-installer/files/
Upvotes: 23
Reputation: 1649
I needed to install command line tools from Xcode. To do so-
Cmd
+,
http://www.hongkiat.com/blog/mountain-lion-git-fix/
Upvotes: 36
Reputation: 1842
The issue is that the git maintainers only support MaxOS10.9 (mavericks). If you have an earlier version, you can't use their distribution.
Recommended by somebody else at work - use (home)brew. Basically with brew installed you can merely use:
brew install git
and it will give you an up to date version. Subsequently to get a new version use:
brew upgrade git
Now brew itself uses git, so it might be that this install is recursive - I had to install it recently for another purpose and it took me several hours - but once you have it there, things should be OK. All I can say is that when I installed brew originally, "git" still referred to the 1.8.x Apple version, and with this change I'm now getting git v2.1.0.
Upvotes: 2
Reputation: 473
I was also having troubles with the same error. I tried the PATH and .bash_profile tricks (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.
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:
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)
With those installed, doing 'git --version' returned this:
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. Since that library didn't change, I would surmise that it isn't Xcode that is fixing things, but the version of Git that is installed.
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. :)
-- J
Upvotes: 5
Reputation: 328
One can also look at https://stackoverflow.com/a/19457333/894120 and just make a .bash_profile, that worked for me.
Upvotes: 2