After running 'autogen.sh', './configure' and then 'make', I keep getting the following error:

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

I was told that boost is clang compiled and thus, GCC incompatible, so I've been trying to recompile boost with GCC via:

  1. HOMEBREW_CC=gcc-10 HOMEBREW_CXX=g++-10 brew install --build-from-source boost --HEAD
  2. `brew install boost --build-from-source --HEAD'

Both of these commands throw the following patching error though:

==> 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

Any idea how to fix this problem and successfully recompile boost? Please let me know!

EDIT: For clarification, I'm trying to build Bitcoin Core v0.21.0 on macOS Catalina version 10.15.7

UPDATE: Finally got this working - turned out I had an outdated version of gcc installed via MacPorts, in addition to Apple's default compiler, which seemed to have been interfering with things. Once I uninstalled MacPorts, everything started working smoothly if I configured with --with-gui=no

  • Provide more details: What is your OS ? Which version ? Are you cross-compiling ? If yes, on which system? For which system ? Mar 16 at 16:40
  • @Gladiator9120 Thanks for the reply - I'm running on macOS Catalina version 10.15.7, and I'm compiling with gcc-10, don't believe I'm cross-compiling but I'm new to this so I may be wrong. If it helps, I've been configuring bitcoin-core with this command: ./configure CXX=g++-10 CPP=cpp-10 CC=gcc-10 Mar 16 at 16:46
  • Alternatively you could do make in the depends folder in core then configure again this would compile the dependencies. I cant get brew's boost to compile with gcc either.
    – MCCCS
    Mar 16 at 17:48
  • Appreciate you trying! And I'll try that now - do I still run ./configure CXX=g++-10 CC=gcc-10 before running make in the depends folder? Mar 16 at 18:25
  • And do I need a --prefix= arg when I configure again? Mar 16 at 18:26

Your Answer

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

Browse other questions tagged or ask your own question.