make failed on mac #10687

issue chinqi opened this issue on June 28, 2017
  1. chinqi commented at 4:11 AM on June 28, 2017: none

    compiled error in macos: Undefined symbols for architecture x86_64: "_CRYPTO_num_locks", referenced from: CInit::CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o) "_RAND_cleanup", referenced from: CInit::~CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o) "_CRYPTO_set_locking_callback", referenced from: CInit::CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o) CInit::~CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o) "_OPENSSL_no_config", referenced from: CInit::CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

  2. fanquake added the label MacOSX on Jun 28, 2017
  3. laanwj added the label Build system on Jun 28, 2017
  4. laanwj commented at 6:58 AM on June 28, 2017: member

    You need to be more specific as to which steps you've followed. You're using Homebrew as documented in build-osx.md? What MacOSX version?

  5. chinqi commented at 7:35 AM on June 28, 2017: none

    I installed library mention in build-osx.md, and all configure was passed. But there was error in link bitcoind excutable. I am using MacBook Air MacOS Sierra 10.12.4

  6. jonasschnelli commented at 8:30 AM on June 28, 2017: contributor

    Can you post your config.log somewhere? Can you also do a make clean and a make V=1 and post the pastebin of that output?

  7. chinqi commented at 9:02 AM on June 28, 2017: none

    Here is the output using option with V=1: /bin/sh ../libtool --tag=CXX --mode=link g++ -std=c++11 -Wstack-protector -fstack-protector-all -fPIE -g -O2 -Wall -Wextra -Wformat -Wvla -Wformat-security -Wno-unused-parameter -Wno-self-assign -Wno-unused-local-typedef -Wno-deprecated-register -Wno-implicit-fallthrough -Qunused-arguments -pthread -pie -L/usr/local/apr/lib/ -Wl,-headerpad_max_install_names -Wl,-dead_strip -o bitcoind bitcoind-bitcoind.o libbitcoin_server.a libbitcoin_common.a univalue/libunivalue.la libbitcoin_util.a libbitcoin_wallet.a libbitcoin_zmq.a libbitcoin_consensus.a crypto/libbitcoin_crypto.a leveldb/libleveldb.a leveldb/libleveldb_sse42.a leveldb/libmemenv.a secp256k1/libsecp256k1.la -L/usr/local/lib -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread -lboost_chrono -ldb_cxx-4.8 -L/usr/local/Cellar/openssl/1.0.2l/lib -lssl -L/usr/local/Cellar/openssl/1.0.2l/lib -lcrypto -lminiupnpc -L/usr/local/Cellar/libevent/2.1.8/lib -levent_pthreads -levent -L/usr/local/Cellar/libevent/2.1.8/lib -levent -L/usr/local/lib -lzmq -L/opt/local/lib -L/usr/local/opt/berkeley-db@4/lib libtool: link: g++ -std=c++11 -Wstack-protector -fstack-protector-all -fPIE -g -O2 -Wall -Wextra -Wformat -Wvla -Wformat-security -Wno-unused-parameter -Wno-self-assign -Wno-unused-local-typedef -Wno-deprecated-register -Wno-implicit-fallthrough -Qunused-arguments -pthread -pie -Wl,-headerpad_max_install_names -Wl,-dead_strip -o bitcoind bitcoind-bitcoind.o -Wl,-bind_at_load -L/usr/local/apr/lib/ libbitcoin_server.a libbitcoin_common.a univalue/.libs/libunivalue.a libbitcoin_util.a libbitcoin_wallet.a libbitcoin_zmq.a libbitcoin_consensus.a crypto/libbitcoin_crypto.a leveldb/libleveldb.a leveldb/libleveldb_sse42.a leveldb/libmemenv.a secp256k1/.libs/libsecp256k1.a -L/usr/local/lib -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread -lboost_chrono -ldb_cxx-4.8 -L/usr/local/Cellar/openssl/1.0.2l/lib -lssl -lcrypto -lminiupnpc -L/usr/local/Cellar/libevent/2.1.8/lib -levent_pthreads -levent /usr/local/lib/libzmq.dylib -lpthread -L/opt/local/lib -L/usr/local/opt/berkeley-db@4/lib -pthread Undefined symbols for architecture x86_64: "_CRYPTO_num_locks", referenced from: CInit::CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o) "_RAND_cleanup", referenced from: CInit::~CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o) "_CRYPTO_set_locking_callback", referenced from: CInit::CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o) CInit::~CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o) "_OPENSSL_no_config", referenced from: CInit::CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

    config.txt

  8. meshcollider commented at 11:36 AM on June 28, 2017: contributor

    I believe this is fixable by giving the location of the boost library in the ./configure step using the --with-boost-libdir=LIB_DIR parameter (just find the lib directory of boost on your machine), try that and let us know how it goes. If it works maybe we should add a note to the build instructions for others with this issue?

  9. chinqi commented at 2:18 AM on June 29, 2017: none

    @MeshCollider Yes, I install two version of boost, but not that problem. The reason is that I installed openssl manual, there are two version of openssl, linker get the wrong dylib, maybe the library version has been changed.

  10. chinqi closed this on Jun 29, 2017

  11. Yoge-Code commented at 10:08 AM on April 17, 2018: none

    Hi @zhci! I'm suffering the same problem with you. After make V=1, it complains:

    libtool: link: /usr/local/bin/ccache g++ -std=c++11 -Wstack-protector -fstack-protector-all -fPIE -g -O2 -Wall -Wextra -Wformat -Wvla -Wformat-security -Wthread-safety-analysis -Wno-unused-parameter -Wno-self-assign -Wno-unused-local-typedef -Wno-deprecated-register -Wno-implicit-fallthrough -Qunused-arguments -pthread -pie -Wl,-headerpad_max_install_names -Wl,-dead_strip -o bitcoind bitcoind-bitcoind.o -Wl,-bind_at_load  libbitcoin_server.a libbitcoin_wallet.a libbitcoin_common.a univalue/.libs/libunivalue.a libbitcoin_util.a libbitcoin_consensus.a crypto/libbitcoin_crypto.a leveldb/libleveldb.a leveldb/libleveldb_sse42.a leveldb/libmemenv.a secp256k1/.libs/libsecp256k1.a -L/usr/local/lib -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread -lboost_chrono -ldb_cxx-4.8 -L/usr/local/Cellar/openssl/1.0.2o_1/lib -lssl -lcrypto -L/usr/local/Cellar/libevent/2.0.22/lib -levent_pthreads -levent -levent -L/usr/local/opt/berkeley-db@4/lib -pthread
    Undefined symbols for architecture x86_64:
      "_CRYPTO_num_locks", referenced from:
          CInit::CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o)
      "_RAND_cleanup", referenced from:
          CInit::~CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o)
      "_CRYPTO_set_locking_callback", referenced from:
          CInit::CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o)
          CInit::~CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o)
      "_OPENSSL_no_config", referenced from:
          CInit::CInit() in libbitcoin_util.a(libbitcoin_util_a-util.o)
    ld: symbol(s) not found for architecture x86_64
    

    There are many versions of openssl(1.0.2f 1.0.2g 1.0.2j 1.0.2k 1.0.2l 1.0.2m 1.0.2n 1.0.2o_1) in the directory(/usr/local/Cellar/openssl). I don't know why I have so many versions, maybe I install them to try to solve problems before. As the complain says, it links to 1.0.2o_1, so I cd the path, and grep all of the undefined symbols one by one

    ➜  1.0.2o_1 grep _RAND_cleanup ./ -rn
    Binary file .//bin/openssl matches
    Binary file .//lib/libcrypto.1.0.0.dylib matches
    Binary file .//lib/libcrypto.a matches
    Binary file .//lib/libcrypto.dylib matches
    

    It seams that all the undefined symbols are exists. I have no idea now. Could you tell me how to solve this problem?

  12. jonasschnelli commented at 11:30 AM on April 17, 2018: contributor

    @YG-FLUSH: Looks like you have misconfigured openssl installation. Try to remove all existing openssl versions with Homebrew and other package managers like "MacPorts". Try to install the version(s) you want. Run ./configure again.

  13. Yoge-Code commented at 3:25 PM on April 17, 2018: none

    @jonasschnelli Thanks for your response. It doesn't work for me ! Here are the commands I tried:

    brew uninstall openssl --ignore-dependencies
    brew uninstall --force openssl  // delete all the versions, the whole openssl path were auto delete after executed this command.
    brew install openssl // openssl/1.0.2o_1 exists again, and now there is only this version. 
    

    After openssl reinstalled , I have retried make clean && ./autogen.sh && ./configure && make. But it complained the same error again.

  14. jonasschnelli commented at 4:28 PM on April 17, 2018: contributor

    Can you pastbin your config.log? Have you looked for other package managers like macports?

  15. Yoge-Code commented at 2:47 AM on April 18, 2018: none

    @jonasschnelli It works!!!! I removed openssl and installed it using macports. Everything works well! Thank you very much!

  16. Patrickxzm commented at 11:18 AM on June 4, 2018: none

    Undefined symbols such as “_CRYPTO_num_locks” exist only in openssl1.0, not in openssl1.1. If a openssl1.1 was installed under /usr/local/lib and -L/usr/local/lib happens to stand before -L/usr/local/Cellar/openssl/1.0.2o/lib, then the linker will find and use the openssl1.1 following the search_libaray_paths. In openssl1.1, these symbols are undefined. Macports happens to overwrite the openssl1.1 library. @jonasschnelli @YG-FLUSH

  17. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me