Bitcoin

Bitcoin Core link error – Bitcoin Stack Exchange

I’m trying to build the Bitcoin Source code v24.2 for Windows using WSL running Ubuntu (latest). I’m following the instructions provided in /doc/build-windows.md. I’m getting a linker error.

/usr/bin/x86_64-w64-mingw32-ld: libbitcoin_node.a(libbitcoin_node_a-txindex.o):txindex.cpp:(.text+0x3009): undefined reference to `node::OpenBlockFile(FlatFilePos const&, bool)'
/usr/bin/x86_64-w64-mingw32-ld: libbitcoin_node.a(libbitcoin_node_a-coinstats.o):coinstats.cpp:(.text+0x13fc): undefined reference to `node::BlockManager::LookupBlockIndex(uint256 const&)'
/usr/bin/x86_64-w64-mingw32-ld: libbitcoin_zmq.a(libbitcoin_zmq_a-zmqpublishnotifier.o):zmqpublishnotifier.cpp:(.text+0x4c3d): undefined reference to `node::ReadBlockFromDisk(CBlock&, CBlockIndex const*, Consensus::Params const&)'
collect2: error: ld returned 1 exit status
make(2): *** (Makefile:7029: bench/bench_bitcoin.exe) Error 1
make(2): *** Waiting for unfinished jobs....
make(2): Leaving directory '/home/madguy/BitcoinSetup/bitcoin/src'
make(1): *** (Makefile:18981: all-recursive) Error 1
make(1): Leaving directory '/home/madguy/BitcoinSetup/bitcoin/src'
make: *** (Makefile:824: all-recursive) Error 1
root@MadGuy:/home/madguy/BitcoinSetup/bitcoin# grep -r "ReadBlockFromDisk" .

I did this:

root@MadGuy:/home/madguy/BitcoinSetup/bitcoin# grep -r "ReadBlockFromDisk" .

And I got (and more):

./src/node/blockstorage.h:bool ReadBlockFromDisk(CBlock& block, const FlatFilePos& pos, const Consensus::Params& consensusParams);
./src/node/blockstorage.h:bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex, const Consensus::Params& consensusParams);
./src/node/blockstorage.cpp:bool ReadBlockFromDisk(CBlock& block, const FlatFilePos& pos, const Consensus::Params& consensusParams)

That means there is a header and definition (and OpenBlockFile(…) as well), but there is no preprocessor. I’m not sure what’s causing this problem. Please help me. It’s urgent..

Related Articles

Back to top button