简体   繁体   English

在Mac OS X上构建bitcoind时出现相同的错误

[英]Getting same error when building bitcoind on Mac OS X

So I am on the docs for building bitcoind for OS X: https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md and I've had the same error every time I try and build. 所以我在为OS X构建bitcoind的文档: https//github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md我每次尝试构建时都遇到了同样的错误。 Here are the steps I take: 以下是我采取的步骤:

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

git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin

./autogen.sh
./configure --with-gui=qt5
make

and here is the error I get: 这是我得到的错误:

OBJCXXLD qt/bitcoin-qt
clang: error: unknown argument: '-framework QtNetwork'
clang: error: unknown argument: '-framework QtWidgets'
clang: error: unknown argument: '-framework QtGui'
clang: error: unknown argument: '-framework QtCore'
clang: error: unknown argument: '-framework QtDBus'
clang: error: unknown argument: '-framework QtCore'
make[2]: *** [qt/bitcoin-qt] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check-recursive] Error 1

I have googled for over a day now. 我现在用Google搜索了一天多了。 I've manually downloaded the open source Qt here: http://www.qt.io/download-open-source/ , I have qt and qt5 installed via brew, etc. I'm not that familiar with C/C++ and compiling code and have no idea what to try next. 我在这里手动下载了开源Qt: http ://www.qt.io/download-open-source/,我通过brew等安装了qt和qt5。我不熟悉C / C ++和编译代码,不知道接下来要尝试什么。 Thanks in advance 提前致谢

First of all try building a non-GUI bitcoind: 首先尝试构建一个非GUI bitcoind:

make clean
./configure --without-gui
make

I had the same error... I fixed this by manually editing the MakeFile 我有同样的错误......我通过手动编辑MakeFile来解决这个问题

The problem is in the QT_DBUS_LIBS, QT_LIBS and QT_TEST_LIBS definitions below... the -F flag and -framework is the one causing the problem. 问题出现在下面的QT_DBUS_LIBS, QT_LIBS and QT_TEST_LIBS定义中...... -F flag and -framework是导致问题的那个。

QT_DBUS_LIBS = -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtDBus -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtCore 
QT_LIBS = -F/usr/local/Cellar/qt5/5.5.0/lib/QtNetwork -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtWidgets -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtGui -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtCore  -framework Foundation -framework ApplicationServices -framework AppKit
QT_TEST_LIBS = -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtTest -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtCore 

Replace these library names with direct references to the library... you have to first find your Qt library path, mine was at /usr/local/Cellar/qt5/5.5.0/lib 用直接引用库替换这些库名...你必须先找到你的Qt库路径,我的位于/usr/local/Cellar/qt5/5.5.0/lib

QT_DBUS_LIBS = /usr/local/Cellar/qt5/5.5.0/lib/QtDBus.framework/QtDBus /usr/local/Cellar/qt5/5.5.0/lib/QtCore.framework/QtCore
QT_LIBS = /usr/local/Cellar/qt5/5.5.0/lib/QtNetwork.framework/QtNetwork /usr/local/Cellar/qt5/5.5.0/lib/QtWidgets.framework/QtWidgets /usr/local/Cellar/qt5/5.5.0/lib/QtGui.framework/QtGui /usr/local/Cellar/qt5/5.5.0/lib/QtCore.framework/QtCore  -framework Foundation -framework ApplicationServices -framework AppKit
QT_TEST_LIBS = /usr/local/Cellar/qt5/5.5.0/lib/QtTest.framework/QtTest /usr/local/Cellar/qt5/5.5.0/lib/QtCore.framework/QtCore

after the changes do 改变之后呢

make clean
make

Works great! 效果很好!

Run the bitcoin-qt which is the GUI version of bitcoin core from the src\\qt directory 从src \\ qt目录运行bitcoin-qt ,它是比特币核心的GUI版本

Have fun! 玩得开心! Please remember if you run configure again these changes will be overwritten. 请记住,如果再次运行configure ,这些更改将被覆盖。

I passed this error by making changes(need to be redone after each ./configure) to Makefile and src/Makefile by 我通过在Makefile和src / Makefile中进行更改(需要在每个./configure之后重做)来传递此错误

1: Taking off the several '-framework Qtxxxx's, since they are kind of redundant with the '-F path/to/qt/' in same line. 1:取消几个'-framework Qtxxxx',因为它们与同一行中的'-F path / to / qt /'有点冗余。

2: Replacing the rest '-framework's to some basic Apple libraries with '-F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks' 2:用'-F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks'替换剩下的'-workwork'到一些基本的Apple库

But after all, I still gave up on qt gui because I then hit exact problem as in below link, which seems the qt5 from homebrew is not for x64, and I'm too lazy to follow the hack here 但毕竟,我仍然放弃了qt gui,因为我接下来确切问题如下面的链接,似乎自制的qt5不适用于x64,而我懒得跟随这里的黑客

https://github.com/bitcoin/bitcoin/issues/5728 https://github.com/bitcoin/bitcoin/issues/5728

I had the same problem and solved it by switching back to qt4 and compiling without GUI: 我遇到了同样的问题并通过切换回qt4并在没有GUI的情况下编译来解决它:

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

git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin

./autogen.sh
./configure
make

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM