Reputation: 423
So I tried to compile one of those altcoins (Bitcoin copies) QT client for Mac OS X Mavericks, and after some time lost putting everything together (boost, db48, miniupnpc, qt 4.8.5 and qt creator 2.5.2) I could compile the code but when arriving in the stage of linking the files, I get an "Undefined symbols for architecture x86_64" error. Here is the whole output :
g++ -headerpad_max_install_names -fstack-protector -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -o Bosscoin-Qt.app/Contents/MacOS/Bosscoin-Qt build/macdockiconhandler.o build/bitcoin.o build/bitcoingui.o build/transactiontablemodel.o build/addresstablemodel.o build/optionsdialog.o build/sendcoinsdialog.o build/addressbookpage.o build/signverifymessagedialog.o build/aboutdialog.o build/editaddressdialog.o build/bitcoinaddressvalidator.o build/version.o build/sync.o build/util.o build/netbase.o build/key.o build/script.o build/main.o build/init.o build/net.o build/irc.o build/checkpoints.o build/addrman.o build/db.o build/walletdb.o build/json_spirit_writer.o build/json_spirit_value.o build/json_spirit_reader.o build/clientmodel.o build/guiutil.o build/transactionrecord.o build/optionsmodel.o build/monitoreddatamapper.o build/transactiondesc.o build/transactiondescdialog.o build/bitcoinstrings.o build/bitcoinamountfield.o build/wallet.o build/keystore.o build/transactionfilterproxy.o build/transactionview.o build/walletmodel.o build/bitcoinrpc.o build/rpcdump.o build/rpcnet.o build/rpcrawtransaction.o build/overviewpage.o build/csvmodelwriter.o build/crypter.o build/sendcoinsentry.o build/qvalidatedlineedit.o build/bitcoinunits.o build/qvaluecombobox.o build/askpassphrasedialog.o build/protocol.o build/notificator.o build/qtipcserver.o build/rpcconsole.o build/scrypt.o build/miningpage.o build/noui.o build/moc_bitcoingui.o build/moc_transactiontablemodel.o build/moc_addresstablemodel.o build/moc_optionsdialog.o build/moc_sendcoinsdialog.o build/moc_addressbookpage.o build/moc_signverifymessagedialog.o build/moc_aboutdialog.o build/moc_editaddressdialog.o build/moc_bitcoinaddressvalidator.o build/moc_clientmodel.o build/moc_guiutil.o build/moc_optionsmodel.o build/moc_monitoreddatamapper.o build/moc_transactiondesc.o build/moc_transactiondescdialog.o build/moc_bitcoinamountfield.o build/moc_transactionfilterproxy.o build/moc_transactionview.o build/moc_walletmodel.o build/moc_overviewpage.o build/moc_csvmodelwriter.o build/moc_sendcoinsentry.o build/moc_qvalidatedlineedit.o build/moc_qvaluecombobox.o build/moc_askpassphrasedialog.o build/moc_notificator.o build/moc_miningpage.o build/moc_rpcconsole.o build/moc_macdockiconhandler.o build/qrc_bitcoin.o
-F/Library/Frameworks -L/Library/Frameworks -lminiupnpc -framework Foundation -framework ApplicationServices -framework AppKit -L/opt/local/lib -L/opt/local/lib/db48 -lssl -lcrypto -ldb_cxx-4.8 -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -framework QtGui -framework QtCore
Undefined symbols for architecture x86_64:
"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
"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
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Bosscoin-Qt.app/Contents/MacOS/Bosscoin-Qt] Error 1
make: Leaving directory `/Users/kriegalex/dev/bosscoin/bosscoin-qt-build-desktop-Qt_4_8_5_in_PATH__System__Release'
13:30:58: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project bosscoin-qt (target: Desktop)
I really tried to go through a lot of threads talking of boost and linking problems and I tried to compile with g++ or clang++ as suggested in the most popular thread, but nothing seems to work.
I would really appreciate some help. I think if someone has already compiled Mac OS QT clients, it should be fairly clear what's wrong.
Best regards
Upvotes: 1
Views: 2982
Reputation: 423
So I found the solution and now it's working, but I'm not sure which one solved the problem :
Get Qt from Homebrew (brew install qt), not from Macports or the official website
Ask macports to install boost and other dependencies with tag +universal
sudo port install boost +universal
Then I just used qmake and make to compile (as described everywhere)
I think it's the second solution that solved it because it compiled the 64 bits libraries.
Thank you bibi to pointing me to the 32/64 bit problem :)
Upvotes: 1
Reputation: 3765
looks like you are building for 64bit but some libs are 32bit try to force it in the .pro
CONFIG+=x86
Upvotes: 0