2013-12-17 314 views
1

所以我試着爲Mac OS X Mavericks編譯其中一個altcoin(比特幣副本)QT客戶端,並且在一段時間以後丟失了所有東西(boost,db48,miniupnpc,qt 4.8.5和qt creator 2.5.2)我可以編譯代碼,但是當到達鏈接文件的階段時,出現「Undefined symbols for architecture x86_64」錯誤。這裏是整個輸出:Mac OS X Linker

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) 

我真的試圖去通過大量的線程提升的談話和連接問題,我試着用G ++或作爲最流行的線程建議鐺++編譯,但似乎沒有任何工作。

我真的很感謝一些幫助。我想如果有人已經編譯了Mac OS QT客戶端,應該很清楚哪裏出了問題。

問候

回答

1

所以我找到了解決辦法,現在它的工作,但我說不準哪一個解決了這個問題:

  • 從家釀獲取QT(BREW安裝QT),而不是從MacPorts的或官方網站

  • 提出的MacPorts安裝升壓和其他依賴與標籤+通用

    sudo port install boost +universal

  • 然後,我只是用QMAKE並編譯(如到處描述的)

我想這是解決它的第二個解決方案,因爲它編譯了64位庫。

謝謝你比比來指點我到32/64位問題:)

0

看起來你正在爲64位,但有些庫是32位 試圖迫使它在的.pro

CONFIG+=x86 
+0

以及感謝您的意見,我看到Qt Creator中只允許我GCC 64位或64鏘位之間進行選擇,所以CONFIG + = x86_64會自動添加到qmake命令中。也許我必須卸載QT4並用一些選項重新安裝以激活32位支持...我將嘗試在沒有Qt Creator的情況下使用32位的qmake,如果這樣做不起作用,我會嘗試重新安裝Qt以允許32位位編譯器是 – Kriegalex

+0

所以我加了CONFIG + = 86在我的.pro,在我的qmake命令主動和我試圖運行Qt Creator中的QMAKE以外的事,但仍然是奇怪的: 鐺++ -c -pipe -fstack保護器-O2 -arch x86_64 -arch i386 爲什麼有兩個「-arch」定義?我沒有看到第一個來自哪裏...... – Kriegalex

+0

可能默認情況下qt使64位嘗試刪除它 CONFIG- = x86_64 – bibi