litecoin-project / litecoin

Litecoin source tree
http://www.litecoin.org
MIT License
4.37k stars 3.03k forks source link

Unable to build litecoind after update to Mavericks (OS X 10.9.2) #148

Closed rubymaniac closed 9 years ago

rubymaniac commented 10 years ago

Yesterday I updated (clean install) my mac to the latest OS X (10.9.2) and tried to build litecoind with no success. I am using homebrew to install the dependencies:

brew install automake autoconf berkeley-db4 openssl protobuf miniupnpc pkg-config boost

and are installing fine. Then I am cloning master-0.8 branch and patching as described in the docs: patch -p1 < contrib/homebrew/makefile.osx.patch.

After I cd src && make -f makefile.osx I get the following error regarding Undefined symbols for architecture x86_64

/bin/sh ../share/genbuild.sh obj/build.h
llvm-g++ -stdlib=libstdc++ -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -DUSE_UPNP=1 -DUSE_IPV6=1 -I/Users/gerry/Documents/software/litecoind/src/leveldb/include -I/Users/gerry/Documents/software/litecoind/src/leveldb/helpers -DHAVE_BUILD_INFO -I"/Users/gerry/Documents/software/litecoind/src" -I"/Users/gerry/Documents/software/litecoind/src/obj" -I"/usr/local/opt/boost/include" -I"/usr/local/opt/berkeley-db4/include" -I"/usr/local/opt/openssl/include" -o litecoind -L"/usr/local/opt/boost/lib" -L"/usr/local/opt/berkeley-db4/lib" -L"/usr/local/opt/openssl/lib" leveldb/libleveldb.a obj/alert.o obj/version.o obj/checkpoints.o obj/netbase.o obj/addrman.o obj/crypter.o obj/key.o obj/db.o obj/init.o obj/keystore.o obj/main.o obj/net.o obj/protocol.o obj/bitcoinrpc.o obj/rpcdump.o obj/rpcnet.o obj/rpcmining.o obj/rpcwallet.o obj/rpcblockchain.o obj/rpcrawtransaction.o obj/script.o obj/scrypt.o obj/sync.o obj/util.o obj/wallet.o obj/walletdb.o obj/hash.o obj/bloom.o obj/noui.o obj/leveldb.o obj/txdb.o -dead_strip -ldb_cxx-4.8 -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -lboost_chrono-mt -lssl -lcrypto -lz -lminiupnpc /Users/gerry/Documents/software/litecoind/src/leveldb/libleveldb.a /Users/gerry/Documents/software/litecoind/src/leveldb/libmemenv.a
Undefined symbols for architecture x86_64:
  "boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool)", referenced from:
      boost::program_options::detail::basic_config_file_iterator<char>::basic_config_file_iterator(std::istream&, std::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool) in util.o
  "boost::program_options::to_internal(std::string const&)", referenced from:
      boost::program_options::detail::basic_config_file_iterator<char>::getline(std::string&) in 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)
make: *** [litecoind] Error 1

_VERSIONS_

  1. autoconf 2.69
  2. automake 1.14.1
  3. berkeley-db4 4.8.30
  4. boost 1.55.0_1
  5. miniupnpc 1.8.20131007
  6. openssl 1.0.1f
  7. pkg-config 0.28
  8. protobuf 2.5.0

I have seen this similar issue and have tried every possible solution those guys gave to no success :/ This is driving me crazy as I need this for my work and I am pretty stuck here. Any help is much appreciated :)

wtogami commented 10 years ago

https://github.com/litecoin-project/litecoin/commits/exp-0.8.6.3-mark3 Did you try this branch?

Does any Bitcoin 0.8.x release build on Mavericks with homebrew?

rubymaniac commented 10 years ago

@wtogami No I haven't tried the branch you mentioned, although I managed to compile litecoind on Mavericks by compiling boost from source. I have documented it here for future reference.

wtogami commented 10 years ago

What version of boost is in homebrew? It sounds like there is a bug in homebrew.

wtogami commented 10 years ago

Note historically 0.8.x and earlier were built with macports so that is the only supported way to build this current version. 0.9+ will be supported by only Homebrew. If you can figure out how to fix Homebrew or adjust 0.8.x's makefiles to support Homebrew without breaking the legacy 0.8.x macports build then patches are accepted.

sikamedia commented 10 years ago

Test environment

  1. Mavericks (OS X 10.9.2)
  2. Command Line Developer tools for OS x Mavericks (version 5.1.0.0)
  3. Macports 2.1.1 for Mavericks

What I have done for building:

  1. sudo port install boost db48@+no_java openssl miniupnpc
  2. git clone git@github.com:litecoin-project/litecoin.git litecoin
  3. cd litecoin
  4. cd src
  5. make -f makefile.osx

Compiling Errors:

llvm-g++ -stdlib=libstdc++ -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -DUSE_UPNP=1 -DUSE_IPV6=1 -I/Users/twan/tao/litecoin/src/leveldb/include -I/Users/twan/tao/litecoin/src/leveldb/helpers -DHAVE_BUILD_INFO -I"/Users/twan/tao/litecoin/src" -I"/Users/twan/tao/litecoin/src"/obj -I"/opt/local/include" -I"/opt/local/include/db48" -o litecoind -L"/opt/local/lib" -L"/opt/local/lib/db48" leveldb/libleveldb.a obj/alert.o obj/version.o obj/checkpoints.o obj/netbase.o obj/addrman.o obj/crypter.o obj/key.o obj/db.o obj/init.o obj/keystore.o obj/main.o obj/net.o obj/protocol.o obj/bitcoinrpc.o obj/rpcdump.o obj/rpcnet.o obj/rpcmining.o obj/rpcwallet.o obj/rpcblockchain.o obj/rpcrawtransaction.o obj/script.o obj/scrypt.o obj/sync.o obj/util.o obj/wallet.o obj/walletdb.o obj/hash.o obj/bloom.o obj/noui.o obj/leveldb.o obj/txdb.o -dead_strip -ldb_cxx-4.8 -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -lboost_chrono-mt -lssl -lcrypto -lz -lminiupnpc /Users/twan/tao/litecoin/src/leveldb/libleveldb.a /Users/twan/tao/litecoin/src/leveldb/libmemenv.a Undefined symbols for architecture x86_64: "boost::program_options::to_internal(std::string const&)", referenced from: boost::program_options::detail::basic_config_file_iterator::getline(std::string&) in util.o "boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::set<std::string, std::less, std::allocatorstd::string > const&, bool)", referenced from: boost::program_options::detail::basic_config_file_iterator::basic_config_fileiterator(std::istream&, std::set<std::string, std::less, std::allocatorstd::string > const&, bool) in util.o "Db::verify(char const, char const, std::ostream, unsigned int)", referenced from: CDBEnv::Verify(std::string, bool (_)(CDBEnv&, std::string)) in db.o CDBEnv::Salvage(std::string, bool, std::vector<std::pair<std::vector<unsigned char, std::allocator >, std::vector<unsigned char, std::allocator > >, std::allocator<std::pair<std::vector<unsigned char, std::allocator >, std::vector<unsigned char, std::allocator > > > >&) in db.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *\ [litecoind] Error 1

sikamedia commented 10 years ago

I tried both homebrew and macports for the libs dependencies installation. It happened with the same compiling errors. It is not only wrong with homebrew packages.

Kudos-Rewards commented 10 years ago

Have the same error - did you get it working?

Kudos-Rewards commented 10 years ago

@rubymaniac could not get your fix to work

wtogami commented 9 years ago

https://github.com/litecoin-project/litecoin/tree/master-0.10 Please use the upcoming v0.10 branch.