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

<p>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. </p>

<p>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.</p>

<p>If you have <a href="https://github.com/Homebrew" rel="nofollow noreferrer"><strong>Homebrew</strong></a> installed, a <code>"% brew list"</code> will indicate if <strong>miniupnpc</strong> package is installed. A <code>"% brew ls -v miniupnpc"</code> will identify the path where are the files miniupnpc package files are installed such as the dynamically linked <strong>lib/libminiupnpc.16.dylib</strong> library file or the statically linked <strong>lib/libminiupnpc.a</strong> library file.  </p>

<p>You will need to read about the <strong>HOMEBREW_LIBRARY_PATH</strong> environmental variable and the <strong>DYLD_LIBRARY_PATH</strong> environmental variable used on a Mac.</p>

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

CC BY-SA 4.0
2019-02-03T09:33:56.603Z
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
CC BY-SA 4.0
2019-02-04T03:33:39.473Z
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
CC BY-SA 4.0
2019-02-04T03:47:12.183Z
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
CC BY-SA 4.0
2019-02-04T03:50:14.917Z
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
CC BY-SA 4.0
2019-02-02T03:02:47.490Z
2019-02-02T03:02:47.490Z
skaht
<p>I'll summarize skaht's answer. Run this and it'll solve your problem:</p>

<pre><code>brew install miniupnpc
ln -s /usr/local/opt/miniupnpc/lib/libminiupnpc.dylib /usr/local/opt/miniupnpc/lib/libminiupnpc.16.dylib
</code></pre>

CC BY-SA 4.0
2019-02-02T07:32:56.530Z
2019-02-02T07:32:56.530Z
MCCCS
<p>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: </p>

<p>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</p>

<p>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.</p>

<p>Anyone out there with an idea of how to solve it?</p>

<installation>
dyld: Library not loaded when running bitcoind on a mac
blueskies
# dyld: Library not loaded when running bitcoind on a mac

(Asked by: username_0 on 2019-02-01)

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?

**Tags:** installation


---

## 2 answers

### Answer by username_1 on 2019-02-02. Score: 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**](https://github.com/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.

> **Comments:**
> **username_0**: Thanks for great information.  It now finds libminiupnpc, as per the answer by username_2. 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.  
> **username_1**: 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  
> **username_1**: 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**  
> **username_1**: 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.  

---

### Answer by username_2 on 2019-02-02. Score: 0

I'll summarize username_1'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

```


---

