【发布时间】:2021-02-24 02:02:55
【问题描述】:
问题:从https://github.com/bitcoin/bitcoin编译比特币源代码时出现问题
构建比特币代码需要 Berkeley DB 4.8(https://github.com/tinybike/get-bdb-4.8)。 没问题。
我的系统在 Ubuntu 20.04 上运行。
$ cpp --version
cpp (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ --version
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
编译比特币代码时,运行“configure”和“make”后出现错误提示找不到iostream.h
...
CXX libbitcoin_server_a-txrequest.o
CXX libbitcoin_server_a-txmempool.o
CXX libbitcoin_server_a-validation.o
CXX libbitcoin_server_a-validationinterface.o
CXX libbitcoin_server_a-versionbits.o
CXX wallet/libbitcoin_server_a-init.o
In file included from ./wallet/bdb.h:27,
from wallet/init.cpp:19:
/bitcoin/src/bdb/build_unix/build/include/db_cxx.h:59:10: fatal error: iostream.h: No such file or directory
59 | #include <iostream.h>
| ^~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:8933: wallet/libbitcoin_server_a-init.o] Error 1
make[2]: Leaving directory '/bitcoin/src'
make[1]: *** [Makefile:15214: all-recursive] Error 1
make[1]: Leaving directory '/bitcoin/src'
make: *** [Makefile:809: all-recursive] Error 1
在检查头文件位置 /usr/include/c++/9 时,我找不到 iostream.h
这是编译器包问题还是比特币没有使用 c++ iostream 头文件
【问题讨论】:
-
你关注the instructions了吗?
-
是的,我做到了。正如我所提到的,我不知道是我的编译器包缺少 iostream.h 还是比特币代码没有正确定义 /bitcoin/src/bdb/build_unix/build/include/db_cxx.h 中的宏 HAVE_CXX_STDHEADERS 以使用 iostream
-
定义 HAVE_CXX_STDHEADERS 不是比特币的工作。这通常是 db_cxx.h 的一部分(紧接在 #ifdef 检查它之前)。您的 db4.8 构建有问题。
标签: bitcoind