在Mac OS X上构建比特币时出现相同的错误
Getting same error when building bitcoind on Mac OS X
所以我在为OS X构建比特币的文档:https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md,每次我尝试构建时都有相同的错误。以下是我采取的步骤:
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
,这里是我得到的错误:
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
我已经用谷歌搜了一天多了。我已经手动下载了开源Qt在这里:http://www.qt.io/download-open-source/,我有Qt和qt5安装通过brew等。我不熟悉C/c++和编译代码,不知道下一步要尝试什么。提前感谢
首先尝试构建一个非gui的比特币:
make clean
./configure --without-gui
make
我有同样的错误…我通过手动编辑MakeFile
修复了这个问题问题在于下面的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
将这些库名替换为对库的直接引用…你必须首先找到你的Qt库路径,我的是在/usr/local/地窖/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
更改后的
make clean
make
作品太棒了!
运行bitcoin-qt
,这是比特币核心的GUI版本从srcqt目录
玩得开心!请记住,如果您再次运行configure
,这些更改将被覆盖。
我通过
对Makefile和src/Makefile进行更改(需要在每个。/configure之后重新做)来传递此错误1:取下几个'-framework Qtxxxx',因为它们在同一行中与'-F path/to/qt/'有点冗余。
2:用"-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/sdk/MacOSX10.10"替换其余的"-framework"到一些基本的Apple库。sdk/系统/图书馆/框架"
但毕竟,我仍然放弃了qt gui,因为我遇到了下面链接中的确切问题,这似乎来自自制的qt5不适合x64,我懒得遵循这里的hack
https://github.com/bitcoin/bitcoin/issues/5728
我有同样的问题,并通过切换回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
相关文章:
- Python os.system() 返回错误值
- 旧C++代码中的目录查找导致 OS X Catalina 10.15 中的目录错误
- 谷歌测试编译错误 Os X:函数式转换从"int"到"internal::FloatingEq2Matcher"的模糊转换<float>
- C++代码编译,但在 Zorin OS 上运行时显示错误
- 在 Mac OS x 中制造期间出现错误未知类型名称"constexpr"
- 在Python中编译C 程序时,请尝试捕获OS错误
- 标准::字符串::空的未定义符号错误;Mac OS High Sierra 上的 c++ 标准方法链接错误
- MXNet ML lib C++ OS X 上的分段错误
- OpenCV3.2 编译错误 MAC OS X
- QT 5.12 Mac OS X版本号码错误
- C++ mac OS X El Capitan上的openmp,Valgrind错误(数据竞赛)
- 在OS X上部署QT应用程序的错误
- cppunit在Mac OS X上与Clang链接错误
- 无法在 Mac OS X 上分配内存错误 - java(xx,xx) malloc: *** mmap(size=XX)
- 对向量 OS 字符串进行排序 C++ 错误 C2784 无法推断模板参数
- 在Mac OS X(10.7)上安装图形工具-已经安装了Boost,但不断出现此错误
- 提升编译错误 Mac OS X 10.7.4
- 在OS X上使用clang编译boost regex时发生链接错误
- 在 OS X 上编译lsd_slam会引发链接错误 ld:找不到 -lGL 的库
- FFMPEG 2.8.x 交叉编译错误在 Mac OS X 10.10 上