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

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.

Related

dyId: Symbol not found: _clock_gettime

I am trying to execute a python code using PyPy2 v5.10 on MacOS El Capitan 10.11.6. However, I keep getting this error during runtime.
dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
Referenced from: /Users/macpro/Downloads/pypy2-v5.10.0-osx64/bin//libpypy-c.dylib
Expected in: flat namespace
dyld: Symbol not found: _clock_gettime
Referenced from: /Users/macpro/Downloads/pypy2-v5.10.0-osx64/bin//libpypy-c.dylib
Expected in: flat namespace
fish: './pypy contactTrace.py' terminated by signal SIGTRAP (Trace or breakpoint trap)
I have read from a few sources that its because El Capitan does not implement the clock but delcares it. Hence, one solution is to upgrade the software or comment out the declaration. Upgrading the software is not an option for me because I have a lot of other scripts running in that particular computer. I was trying to comment out the declaration but I am unable to find where I can comment it off. Also, will it really solve the issue? Or are there any more simpler solutions to it. I am not very familiar with the MacOS platform and am only using it for this project.
Thanks in advance!
That sounds like a wrongly linked libSystem.dylib, and that will be hard to fix (e.g. checking libs with otool and modifying lib with install_name_tool). However, there are newer versions of PyPy. Do you have tried them?

dyld: Library not loaded: #rpath/libswiftQuartzCore.dylib

After the update of Carthage to 0.18 (via homebrew), call of the carthage become broken:
$ carthage
dyld: Library not loaded: #rpath/libswiftQuartzCore.dylib
Referenced from: /Library/Frameworks/ReactiveCocoa.framework/ReactiveCocoa
Reason: image not found
Trace/BPT trap: 5
I tried to reinstall or to clean and update manually. Both variants didn't work for me.
Problem was solved by remove /Library/Frameworks/ReactiveCocoa.framework which was placed manually sometimes ago.
#rpath contains multiple locations and after finding that ReactiveCocoa is at /Library/Frameworks/ linker stops there. After removal it finds another location of ReactiveCocoa which also contains required dependencies.

pyside-rcc "dyld: Library not loaded:..."

I'm a python and Qt rookie and I have some problems running pyside-rcc (and pyrcc4). The problem is not the link to the executable but a library problem it seems. That I'm not a unix wizard, probably doesn't help either:)
When I run $ pyside-rcc i get the following error
dyld: Library not loaded: #rpath/lib/QtCore.framework/Versions/4/QtCore
Referenced from: /Users/[USERNAME]/Library/Enthought/Canopy_64bit/User/bin/pyside-rcc
Reason: image not found
Trace/BPT trap: 5
For $ pyrcc4 the error is similar but not exactly the same:
dyld: Library not loaded: #rpath/lib/QtXml.framework/Versions/4/QtXml
Referenced from: /Users/[USERNAME]/Library/Enthought/Canopy_64bit/User/bin/pyrcc4
Reason: image not found
Trace/BPT trap: 5
I'm running Mac OS X 10.9
I have Enthought Canopy (v.1.5.1) installed with the following
packages: Qt 4.8.5-10, PySide 1.2.2, PyQt 4.11.0-1
I have also installed Qt Creator (3.3.0) which came with Qt 5.4.0
To activate the Canopy python packages system wide I have the following line in mt .bash_profile
VIRTUAL_ENV_DISABLE_PROMPT=1 source /Users/[USERNAME]/Library/Enthought/Canopy_64bit/User/bin/activate
I have found a lot of posts with dyld: Library not loaded... errors but I can't find the right path to the Qt framework and thus, I'm stuck... Does anyone with Enthought Canopy have the same problem?
Thank you in advance, I appreciate any help.
Solved! I found a similar question here: http://qt-project.org/forums/viewthread/9024
The libraries (when installed through Canopy) is in /Users/[USERNAME]/Library/Enthought/Canopy_64bit/User/lib
Apparently they should be in /Library/Frameworks After copying them here it works...

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.

libiconv.2.dylib not found

I get this error on my Mac OS Lion when I use gcc make:
dyld: Symbol not found: _iconv
Referenced from: /usr/lib/libcups.2.dylib
Expected in: /opt/local/lib/libiconv.2.dylib
in /usr/lib/libcups.2.dylib
dyld: Symbol not found: _iconv
Referenced from: /usr/lib/libcups.2.dylib
Expected in: /opt/local/lib/libiconv.2.dylib
in /usr/lib/libcups.2.dylib
./configure.sh: line 364: 18386 Trace/BPT trap: 5 $QTDIR/bin/qmake "$SRCDIR/$product.pro"
qmake failed
Note: I installed Macports in my machine. This used to work before, is this a known issue with MacPorts?
you can use the built in libiconv by selecting your target, going to the Build Phases tab and adding it to the link libraries and frameworks build phase.
as a general rule if you are missing linker symbols you can look up the symbol in your project and see what header they are from, and you can then usually figure out the appropriate library or framework.
in this case it tells you what library it is expecting...
you will want to use the built in version for a dynamic library, because with default linker flags, if this built product were to get moved to another computer it would try to resolve the symbols at run time in that location, and crash.

Resources