Compiling

比特幣編譯錯誤:聲明衝突

  • August 27, 2019

我正在嘗試在 Ubuntu 上編譯比特幣原始碼 (1),我得到:

In file included from bench/data.cpp:10:0:
./bench/data/block413567.raw.h:1:40: error: conflicting declaration ‘const unsigned char benchmark::data::block413567 []’
static unsigned const char block413567[] = {
                                       ^
In file included from bench/data.cpp:5:0:
./bench/data.h:14:35: note: previous declaration as ‘const std::vector<unsigned char> benchmark::data::block413567’
extern const std::vector<uint8_t> block413567;
                                  ^~~~~~~~~~~
...
/usr/include/c++/7/bits/stl_vector.h:270:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/7/bits/stl_vector.h:259:7: note: candidate: std::vector<_Tp, _Alloc>::vector() [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]
      vector()
      ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:259:7: note:   candidate expects 0 arguments, 2 provided
Makefile:10306: recipe for target 'bench/bench_bench_bitcoin-data.o' failed
make[2]: *** [bench/bench_bench_bitcoin-data.o] Error 1

網際網路搜尋並沒有給我非常可操作的線索。


  1. 掌握最新3489b715120b1bf7559fbddf03cd87b889fdca47

我需要從舊版本中刪除過時的文件,只需執行make clean.

<https://github.com/bitcoin/bitcoin/issues/16479#issuecomment-515791321>

引用自:https://bitcoin.stackexchange.com/questions/89440