<p>Berkeley-db from brew which is clang compiled is GCC incompatible. Either Recompile berkeley-db4 with GCC:</p>
<p><code>HOMEBREW_CC=gcc-10 HOMEBREW_CXX=g++-10 brew reinstall --build-from-source berkeley-db4</code></p>
<p>or compile Core with clang</p>
<p>Discussion: <a href="https://github.com/bitcoin/bitcoin/issues/3228" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/issues/3228</a></p>

CC BY-SA 4.0
2021-03-15T20:28:26.137Z
Thanks for the reply - that fixed the Berkeley-DB problem but I just received this error message after running 'make check':    `Undefined symbols for architecture x86_64:
  "__ZN5boost10filesystem4path5imbueERKSt6locale", referenced from:
      __Z16SetupEnvironmentv in libbitcoin_util.a(libbitcoin_util_a-system.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [bitcoind] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check-recursive] Error 1
`.  Any ideas how to fix this one?
Julian Moraes
CC BY-SA 4.0
2021-03-15T20:33:00.313Z
You need to rebuild boost too similarly
MCCCS
CC BY-SA 4.0
2021-03-15T23:41:20.850Z
I'm struggling to figure out the command to do that - do you know what it should be?
Julian Moraes
CC BY-SA 4.0
2021-03-15T23:58:06.673Z
Running `HOMEBREW_CC=gcc-10 HOMEBREW_CXX=g++-10 brew install --build-from-source boost --HEAD`   or  `brew install boost --build-from-source --HEAD` leads to the following patch error: `==> Patching
==> Applying 7b3fc734242eea9af734d6cd8ccb3d8f6b64c5b2.patch
patching file boost-install.jam
Hunk #1 FAILED at 483.
1 out of 1 hunk FAILED -- saving rejects to file boost-install.jam.rej`
Julian Moraes
CC BY-SA 4.0
2021-03-16T07:49:20.163Z
Remove `--HEAD`
MCCCS
CC BY-SA 4.0
2021-03-16T15:41:22.303Z
Just tried and got this error: `==> ./b2 headers
Last 15 lines from /Users/julian_moraes/Library/Logs/Homebrew/boost/02.b2:
* rule clang.init-cxxstd-flags ( toolset : condition * : version )
* called with: ( clang-darwin : <toolset>clang :  )
* missing argument version
/private/tmp/boost-20210316-2413-8781zu/boost_1_75_0/tools/build/src/tools/clang.jam:54:see definition of rule 'clang.init-cxxstd-flags' being called
/private/tmp/boost-20210316-2413-8781zu/boost_1_75_0/tools/build/src/build/toolset.jam:44: in toolset.using
/private/tmp/boost-20210316-2413` .. It continues for a bit after
Julian Moraes
CC BY-SA 4.0
2021-03-16T15:42:49.443Z
Not sure why clang is being used so would appreciate any additional insights. Thanks a bunch for the help!
Julian Moraes
CC BY-SA 4.0
2021-03-15T19:37:48.110Z
2021-03-15T19:37:48.110Z
MCCCS
<p>I keep getting this error message after running 'make' or 'make check':</p>
<pre><code>Making check in src
  CXXLD    bitcoind
Undefined symbols for architecture x86_64:
  &quot;__ZN2Db6verifyEPKcS1_PSoj&quot;, referenced from:
      __ZN16BerkeleyDatabase6VerifyER13bilingual_str in libbitcoin_wallet.a(libbitcoin_wallet_a-bdb.o)
  &quot;__ZN5boost10filesystem4path5imbueERKSt6locale&quot;, referenced from:
      __Z16SetupEnvironmentv in libbitcoin_util.a(libbitcoin_util_a-system.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [bitcoind] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check-recursive] Error 1
</code></pre>
<p>Any ideas on how to fix it?</p>

CC BY-SA 4.0
2021-03-15T19:31:42.050Z
How did you install Berkeley-DB? What compiler are you using to build Core?
MCCCS
CC BY-SA 4.0
2021-03-15T19:35:52.800Z
I installed Berkeley-DB using brew (brew install berkeley-db4) and am using gcc-10. I had to explicitly configure like this though because compiling C++ on Catalina is a pain: './configure CXX=g++-10 CPP=cpp-10 CC=gcc-10'
Julian Moraes
CC BY-SA 4.0
2021-03-15T19:49:31.770Z
I don't think setting CPP is needed. I set the variables with `export` in `~/.zprofile` and configure automatically takes them from the env
MCCCS
<bitcoin-core><compiling>
Unable to build Bitcoin on Mac Catalina
Julian Moraes
# Unable to build Bitcoin on Mac Catalina

(Asked by: username_0 on 2021-03-15)

I keep getting this error message after running 'make' or 'make check':
Making check in src
  CXXLD    bitcoind
Undefined symbols for architecture x86_64:
  "__ZN2Db6verifyEPKcS1_PSoj", referenced from:
      __ZN16BerkeleyDatabase6VerifyER13bilingual_str in libbitcoin_wallet.a(libbitcoin_wallet_a-bdb.o)
  "__ZN5boost10filesystem4path5imbueERKSt6locale", referenced from:
      __Z16SetupEnvironmentv in libbitcoin_util.a(libbitcoin_util_a-system.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [bitcoind] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check-recursive] Error 1

Any ideas on how to fix it?

**Tags:** bitcoin-core, compiling

> **Comments:**
> **username_1**: How did you install Berkeley-DB? What compiler are you using to build Core?  
> **username_0**: I installed Berkeley-DB using brew (brew install berkeley-db4) and am using gcc-10. I had to explicitly configure like this though because compiling C++ on Catalina is a pain: './configure CXX=g++-10 CPP=cpp-10 CC=gcc-10'  
> **username_1**: I don't think setting CPP is needed. I set the variables with `export` in `~/.zprofile` and configure automatically takes them from the env  

---

## 1 answers

### Answer by username_1 on 2021-03-15. Score: 1 | Accepted answer

Berkeley-db from brew which is clang compiled is GCC incompatible. Either Recompile berkeley-db4 with GCC:

`HOMEBREW_CC=gcc-10 HOMEBREW_CXX=g++-10 brew reinstall --build-from-source berkeley-db4`

or compile Core with clang

Discussion: <https://github.com/bitcoin/bitcoin/issues/3228>

> **Comments:**
> **username_0**: Thanks for the reply - that fixed the Berkeley-DB problem but I just received this error message after running 'make check':    `Undefined symbols for architecture x86_64:   "__ZN5boost10filesystem4path5imbueERKSt6locale", referenced from:       __Z16SetupEnvironmentv in libbitcoin_util.a(libbitcoin_util_a-system.o) ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status make[2]: *** [bitcoind] Error 1 make[1]: *** [check-recursive] Error 1 make: *** [check-recursive] Error 1 `.  Any ideas how to fix this one?  
> **username_1**: You need to rebuild boost too similarly  
> **username_0**: I'm struggling to figure out the command to do that - do you know what it should be?  
> **username_0**: Running `HOMEBREW_CC=gcc-10 HOMEBREW_CXX=g++-10 brew install --build-from-source boost --HEAD`   or  `brew install boost --build-from-source --HEAD` leads to the following patch error: `==> Patching ==> Applying 7b3fc734242eea9af734d6cd8ccb3d8f6b64c5b2.patch patching file boost-install.jam Hunk #1 FAILED at 483. 1 out of 1 hunk FAILED -- saving rejects to file boost-install.jam.rej`  
> **username_1**: Remove `--HEAD`  
> **username_0**: Just tried and got this error: `==> ./b2 headers Last 15 lines from /Users/julian_moraes/Library/Logs/Homebrew/boost/02.b2: * rule clang.init-cxxstd-flags ( toolset : condition * : version ) * called with: ( clang-darwin : <toolset>clang :  ) * missing argument version /private/tmp/boost-20210316-2413-8781zu/boost_1_75_0/tools/build/src/tools/clang.jam:54:see definition of rule 'clang.init-cxxstd-flags' being called /private/tmp/boost-20210316-2413-8781zu/boost_1_75_0/tools/build/src/build/toolset.jam:44: in toolset.using /private/tmp/boost-20210316-2413` .. It continues for a bit after  
> **username_0**: Not sure why clang is being used so would appreciate any additional insights. Thanks a bunch for the help!  

---

