git command-line on Mac OS error "dyld: Symbol not found: ___strlcpy_chk"
Asked Answered
E

3

9

I installed git on Mac os, when i try to create a new repository with git init, i get this error :

 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

NB: I don't have Xcode installed.

Essieessinger answered 11/4, 2014 at 14:16 Comment(2)
For anyone on Mountain Lion, your problem might be that you've installed Git 2.2.1 for Mavericks. Visit the downloads page and select the Snow Leopard installation instead. This addressed the issue for me, while reinstalling Command Line Tools and fudging with other nonsense didn't. If you do install Command Line Tools, it will include an old version of Git, so to ensure you're using 2.2.1 (or whatever the version is when you read this), just add /usr/local/git/bin to your PATH.Pliable
Possible duplicate of Git commands not working in Mac terminal: "dyld: Symbol not found: ___strlcpy_chk" errorFlushing
P
6

you can consider my solution: Open XCode(Install one if you didn't install it.), and press "COMMAND + ,". Click "Download". Find "command line tool", download and install it.Then restart your mac,done!

Hope you can solve it with the same way.

Permian answered 12/5, 2014 at 9:21 Comment(0)
P
2

Looks like /usr/local/git/bin/git has been compiled with the wrong -mmacosx-version-min value. You don't mention how it got there, so I cannot help further along that path.

I would recommend installing macports and simply doing:

$ sudo port install git-core git-extras
Phebephedra answered 11/4, 2014 at 14:44 Comment(3)
I didn't found this file /usr/local/bin/gitEssieessinger
@nabill. Fixed in answer.Phebephedra
Ok, i got this error : ` sudo port install git-core git-extras Error: Error: No Xcode installation was found. Error: Please install Xcode and/or run xcode-select to specify its location. Error: `Essieessinger
H
-1

I was also having troubles with the same error after running this command:

$ git clone https://bitbucket.org/name/testproject.git

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.

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

Hanley answered 30/5, 2014 at 23:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.