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

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

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

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.

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!

Related

AdaCore gnatstudio builds but won't run

Mac mini (2018)
OSX 10.15.5
XCode 11.5
GNAT 2020
Miniconda environment python 3.7.7
I have built gnatstudio from https://github.com/AdaCore/gps-master.
However, the command gnatstudio/obj/gnatstudio fails with:
dyld: Library not loaded: /gnatmail/sandbox/a2c2/x86_64-darwin/gcc-c/pkg/lib/libstdc++.6.dylib
Referenced from: /System/Volumes/Data/Applications_Packages/gps-master/gnatstudio/obj/gnatstudio
Reason: image not found
zsh: abort gnatstudio/obj/gnatstudio
I can find no reference to /gnatmail/sandbox/a2c2/x86_64-darwin/gcc-c/pkg/lib/libstdc++.6.dylib in my gps build instructions; not in any Makefile or gpr.
I have found libstdc++.6.dylib in /opt/GNAT/2020/lib, /opt/GNAT/2019/lib/gps and a few other less relevant locations.

Symbol not found mac OS X

whenever I run "cufflinks" on the OS X terminal , I get this error:
dyld: Symbol not found: __ZN5boost11this_thread5hiden11sleep_untilERK8timespec
Referenced from: /usr/local/bin/cufflinks
Expected in: /usr/local/opt/boost/lib/libboost_thread-mt.dylib
Trace/BPT trap: 5
I tried brew upgrade and update, I also tried reinstall cufflinks , I obtained no result.
Any idea?
performing ls-l to the directory WILL return a libboost_thread-mt.dylib file amongst other files as well
-r--r--r-- 1 admin 165400 Apr 17 14:18 libboost_thread-mt.dylib

Trying to compile GnuPG-2.1.1 on OS X Yosemite 10.10.1

While trying to build the latest GnuPG (2.1.1 modern), my build fails when trying to link t-stringhelp. make outputs:
ld: warning: ignoring file libcommon.a, file was built for archive which is not the architecture being linked (x86_64): libcommon.a
Undefined symbols for architecture x86_64:
"_compare_filenames", referenced from:
_main in t-stringhelp.o
"_make_absfilename_try", referenced from:
_main in t-stringhelp.o
"_make_filename_try", referenced from:
_main in t-stringhelp.o
"_percent_escape", referenced from:
_main in t-stringhelp.o
"_strconcat", referenced from:
_main in t-stringhelp.o
"_xstrconcat", referenced from:
_main in t-stringhelp.o
I don't know how to fix this as libcommon is part of the source, so it should build fine. When building with CFLAGS="-m64" (-arch x86_64 does nothing), I get this:
ld: warning: ignoring file ../common/libgpgrl.a, file was built for archive which is not the architecture being linked (x86_64): ../common/libgpgrl.a
Undefined symbols for architecture x86_64:
"_gnupg_rl_initialize", referenced from:
_main in gpg.o
I've also rebuilt all the depandancies (as I built them on Mavericks), except pinentry, as it can't find libiconv which is also installed. My configure outputs that its target is Darwin (x86_64-apple-darwin14.0.0), so this should work. I have also got all the latest prerequisites, tried to install everything in its own directory (--prefix=/usr/local/gnupg-2.1.1), build all the dependancies and GnuPG as 32 bits (again, fails on same error), created a separate build folder and tried to build in there, but only one thing so far has solved the error: looking at how libgpgrl.a is being built - it's only component is common/gpgrlhelp.c - so I cd'ed into g10 and tried to build gpg2, replacing ../common/libgpgrl.a with ../common/gpgrlhelp.o, the lib common.a with all of its object files, for all the libraries that didn't work. Then some programs weren't linking to libksba libgcrypt and libassuan, so I changed the Makefiles, so that they could link. I can now compile all the code well, I installed everything, but I get a new error, when I try to run gpg2:
dyld: lazy symbol binding failed: Symbol not found: __gcry_mpi_init
Referenced from: /usr/local/gnupg-2.1.1/lib/libgcrypt.20.dylib
Expected in: flat namespace
dyld: Symbol not found: __gcry_mpi_init
Referenced from: /usr/local/gnupg-2.1.1/lib/libgcrypt.20.dylib
Expected in: flat namespace
I have everything in my path, which is:
/usr/local/gnupg-2.1.1/bin:/usr/local/gnupg-2.1.1/lib:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
I could compile GnuPG-2.0.22 on Mavericks, but no version of GnuPG builds on Yosemite.
Please help, I'm really confused.
I’ve been running GnuPG 2.1 on Yosemite 10.10.2 (the latest public beta of as of this writing) for about a week and it’s been fine.
You can follow these directions for using brew tap or you can use the raw URL: brew install https://github.com/mtigas/homebrew-gpg21/raw/master/Formula/gnupg2.rb.
Note this formula installs GnuPG 2.1; not GnuPG 2.1.1, the version originally asked about. I can confirm this bug where gpg2 --refresh-keys fails with some keyservers using 2.1 (apparently fixed in 2.1.1) but it’ll get you 90% there.
It shouldn’t be hard to update the formula to install 2.1.1.
Update
Someone submitted a pull request for GNuPG 2.1.1 support—I just tried it and it worked great. Short answer: brew install https://raw.githubusercontent.com/calebthompson/homebrew-gpg21/2.1.1/Formula/gnupg2.rb.
Personally, I would install homebrew, which is a one-liner pasted from their website (http://brew.sh) then do
brew install gnupg
If therw are any problems, run
brew doctor
and heed the good doctor's advice.
Turns out I had a ranlib in /usr/local/bin/ranlib. It was broken, I don't know how it got there (I did try to build gcc at some point, it doesn't support make uninstall, so that's probably why). I just ran:
sudo mv /usr/local/ranlib /usr/local/ranlib_old
Then I just rebuilt all the dependancies, and it worked!

Library not loaded: /opt/local/lib/libffi.5.dylib

I am compiling some C++ code on Mac OX Snow Leopard (MacPorts).
I got error message:
collect2: error: ld terminated with signal 5 [Trace/BPT trap]
dyld: Library not loaded: /opt/local/lib/libffi.5.dylib
Referenced from: /opt/local/libexec/llvm-3.3/lib/libLTO.dylib
Reason: image not found
I know libffi was updated to a newer version which now provides libffi version 6 that I have now.
Any help? Thanks.
Try 'sudo port rev-upgrade' first.* This should identify missing / mis-linked files and rebuild the required ports. (Will use pre-compiled binaries rather than build when permitted by licenses and config.)
In general, you may find the mailing list the most productive place to ask these questions. https://lists.macosforge.org/mailman/listinfo/macports-users
actually, do 'sudo port selfupdate && sudo port upgrade outdated' first if you haven't recently.

dyld: Library not loaded: /opt/local/lib/libglib-2.0.0.dylib

I've gotten MDB-Tools compiled for OSX, but when I try to run a sample command line program on another computer I get this error:
dyld: Library not loaded: /opt/local/lib/libglib-2.0.0.dylib
Referenced from: /Users/dev/mdb/mdb-test
Reason: image not found
Trace/BPT trap: 5
I believe that this means that the target system is missing a library and I think its something to do with linkage, but I'm not exactly positive how to go about fixing this. Could anyone point me in the right direction?
The /opt/local directory is typically used by MacPorts. Your compiled program has a dependency on glib from MacPorts. You either need to install that on the machines where you want to run your program or you need to bundle together your program and all of the libraries it depends on.
Check Apple's Dynamic Library Programming Topics.
Yes, I had hit similar issue while upgrading vim on Mac.
$ vi linkedlist.cc
dyld: Library not loaded: /usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/Python
Referenced from: /usr/local/bin/vim
Reason: image not found
Abort trap: 6
To solve the problem, I tried to upgrade packages.
$ brew update
Already up-to-date.
$ brew upgrade
It started working after doing upgrades.

Resources