在 linux 上编译比特币源代码 (https://github.com/bitcoin/bitcoin) 时出现问题

如何解决在 linux 上编译比特币源代码 (https://github.com/bitcoin/bitcoin) 时出现问题

问题:从 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 头文件

解决方法

我猜您在安装所需的系统包之前尝试构建“depends”BDB,这产生了无效/无法使用的构建。

尝试删除您当前的“依赖”构建并重新构建。

或者,您可以将我的 db48 PPA 用于 Ubuntu:https://launchpad.net/~luke-jr/+archive/ubuntu/db48

,

我遇到了同样的错误,但它是在我用 berkeley db 构建零冰时出现的。我发现了一些关于 libdb 的用法,其中大部分在代码的开头添加了 #define HAVE_CXX_STDHEADERS,所以我尝试在 ICEDIR/cpp/include/IceUtil/Config.h 中添加这个定义。它有效。希望它对你有效。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?