2

I'm having trouble running bitcoind on my Mac (Sierra). I previously had bitcoind installed, compiled from source, but had to remove it when I was running low on space. I recently installed Bitcoin Core again, but this time I downloaded a .dmg file. It installed fine and I can run Bitcoin-Qt. Now, when I try to run bitcoind from the command line, or use bitcoin-cli, I get the following error message:

dyld: Library not loaded: /usr/local/opt/miniupnpc/lib/libminiupnpc.16.dylib Referenced from: /usr/local/bin/bitcoind Reason: image not found Abort trap: 6

I don´t seem to be able to fix this. I might be an easy fix, but I haven´t been able to take care of it.

Anyone out there with an idea of how to solve it?

0

The answer below is likely not complete for your situation, but will get things rolling if you take the initiative.

A compiled executable that is statically linked is 100% complete for a particular computer architecture, and are much larger in size than dynamically linked executable that tend to port better across computers with varying architectures.

Your improperly functioning executables are using dynamically linked libraries instead of using statically linked libraries. Your executable(s) are looking for a dynamically linked library (file) in the /usr/local/opt/miniupnpc/lib/ directory called miniupnpc.16.dylib.

If you have Homebrew installed, a "% brew list" will indicate if miniupnpc package is installed. A "% brew ls -v miniupnpc" will identify the path where are the files miniupnpc package files are installed such as the dynamically linked lib/libminiupnpc.16.dylib library file or the statically linked lib/libminiupnpc.a library file.

You will need to read about the HOMEBREW_LIBRARY_PATH environmental variable and the DYLD_LIBRARY_PATH environmental variable used on a Mac.

The path for your command line interface and the *.dmg file are different. Use the UNIX "% which bitcoind" or "% which bitcoin-cli" to identify what the command line path really is set to within your UNIX shell.

4
  • Thanks for great information. It now finds libminiupnpc, as per the answer by MCCCS. Hwever, now I get: dyld: Library not loaded: /usr/local/opt/libevent/lib/libevent_pthreads-2.0.5.dylib It seems the link /usr/local/opt/libevent/lib/libevent_pthreads.dylib already exists. Shouldn't this be working already? I was researching the environment variables you mentioned and it seems none of them are set.
    – blueskies
    Feb 3 '19 at 9:33
  • Don't forget to % brew update prior to each % brew install package_formula. You will also want to research the PKG_CONFIG environmental variable associated with the pkg-config package. There are numerous mechanisms to enable dynamically linked libraries to be discovered during runtime. In your case, look for this file /usr/local/opt/libevent/lib/pkgconfig/libevent_pthreads.pc that probably needs to be found when compiling bitcoind. - Cheers
    – skaht
    Feb 4 '19 at 3:33
  • Here is a partial example for how configuring enables *..dylib files to be located % ./configure --prefix=$HOME/Projects/BFGminer --build=$architecture --host=$architecture --target=$architecture CPPFLAGS="-I$HOME/Projects/BFGminer/UThash/uthash-master/src" PKG_CONFIG_PATH=$HOMEBREW_PREFIX/$HOMEBREW/Cellar/curl/lib/pkgconfig:$HOMEBREW_PREFIX/$HOMEBREW/Cellar/jansson/lib/pkgconfig:$HOMEBREW_PREFIX/$HOMEBREW/Cellar/libmicrohttpd/lib/pkgconfig:$HOMEBREW_PREFIX/$HOMEBREW/Cellar/libevent/lib/pkgconfig --enable-scrypt --enable-opencl --disable-debug
    – skaht
    Feb 4 '19 at 3:47
  • It is possible to install Hombrew packages in non-standard unprivileged locations to minimize the of privileged brew commands: doctor, man, update, install, uninstall, pull, link, unlink, pin, unpin that normally impact privileged directories. See environmental variables defined at github.com/Homebrew/brew/blob/master/docs/External-Commands.md. This allows package deconfliction when building disparate code bases somewhat analogous to docker by tweaking the paths to where packages are found. Share a little love please by up voting.
    – skaht
    Feb 4 '19 at 3:50
0

I'll summarize skaht's answer. Run this and it'll solve your problem:

brew install miniupnpc
ln -s /usr/local/opt/miniupnpc/lib/libminiupnpc.dylib /usr/local/opt/miniupnpc/lib/libminiupnpc.16.dylib

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.