<p>Fellow person with the same problem.</p>
<p>If you're building while not following the provided documentation at <a href="https://github.com/bitcoin/bitcoin/blob/d3a352256064d62a3e2e2d054ffa0faecb49dd71/doc/build-windows.md" rel="nofollow noreferrer">bitcoin/doc/build_windows.md</a> or any platform whatsoever. You should follow whatever instructions are given in <a href="https://github.com/bitcoin/bitcoin/tree/d3a352256064d62a3e2e2d054ffa0faecb49dd71/doc" rel="nofollow noreferrer">bitcoin/doc</a>. You'll need <code>cmake</code> and <code>libtool-bin</code> and execute any libtool commands given as warnings during dependency build or you'll have to juggle (I don't know what this word means) errors.</p>

CC BY-SA 4.0
2024-09-26T02:06:13.310Z
2024-09-26T02:06:13.310Z
Ahsan Khan
<p>I'm trying to build Bitcoin Source code v24.2 for Windows using WSL running Ubuntu (latest). I'm following the <a href="https://github.com/bitcoin/bitcoin/blob/v24.2/doc/build-windows.md#building-for-64-bit-windows" rel="nofollow noreferrer">instructions</a> instructions given the /doc/build-windows.md. I got linker errors:</p>
<pre><code>/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&amp;, 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&amp;)'
/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&amp;, CBlockIndex const*, Consensus::Params const&amp;)'
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 &quot;ReadBlockFromDisk&quot; .
</code></pre>
<p>I did:</p>
<pre><code>root@MadGuy:/home/madguy/BitcoinSetup/bitcoin# grep -r &quot;ReadBlockFromDisk&quot; .
</code></pre>
<p>and got (and some more):</p>
<pre><code>./src/node/blockstorage.h:bool ReadBlockFromDisk(CBlock&amp; block, const FlatFilePos&amp; pos, const Consensus::Params&amp; consensusParams);
./src/node/blockstorage.h:bool ReadBlockFromDisk(CBlock&amp; block, const CBlockIndex* pindex, const Consensus::Params&amp; consensusParams);
./src/node/blockstorage.cpp:bool ReadBlockFromDisk(CBlock&amp; block, const FlatFilePos&amp; pos, const Consensus::Params&amp; consensusParams)
</code></pre>
<p>which means the headers and definitions exist (same goes for OpenBlockFile(...)). But they've no preprocessors either, I'm not sure what can cause this issue. <strong>Please help, it's kinda urgent</strong>.</p>

CC BY-SA 4.0
2024-09-23T16:35:08.240Z
Hi Ahsan, v24.2 has reached EOL earlier this year, is there a reason you're not building a more recent version? And do you really need to build from source as opposed to using the pre-built release binary?
Vojtěch Strnad
CC BY-SA 4.0
2024-09-25T16:40:08.007Z
@VojtěchStrnad Thank you, man!! At least you replied. But I solved it. I wasn't following any of the provided instructions in bitcoin/build_windows.md. In fact, I didn't everything is automated; I love that repo. Someone else asked for help, it wasn't mine.

THANK YOU, I don't know why. But I'm feeling good today. Hope you also have a good day.
Ahsan Khan
CC BY-SA 4.0
2024-09-25T16:43:26.597Z
@VojtěchStrnad and you didn't get mad like some other nerdies setting in the basement.
Ahsan Khan
<bitcoin-core><bitcoin-core-development><compiling><error>
Bitcoin Core linking error
Ahsan Khan
# Bitcoin Core linking error

(Asked by: username_0 on 2024-09-23)

I'm trying to build Bitcoin Source code v24.2 for Windows using WSL running Ubuntu (latest). I'm following the instructions instructions given the /doc/build-windows.md. I got linker errors:
/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:
root@MadGuy:/home/madguy/BitcoinSetup/bitcoin# grep -r "ReadBlockFromDisk" .

and got (and some 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)

which means the headers and definitions exist (same goes for OpenBlockFile(...)). But they've no preprocessors either, I'm not sure what can cause this issue. Please help, it's kinda urgent.

**Tags:** bitcoin-core, bitcoin-core-development, compiling, error

> **Comments:**
> **username_1**: Hi Ahsan, v24.2 has reached EOL earlier this year, is there a reason you're not building a more recent version? And do you really need to build from source as opposed to using the pre-built release binary?  
> **username_0**: @VojtěchStrnad Thank you, man!! At least you replied. But I solved it. I wasn't following any of the provided instructions in bitcoin/build_windows.md. In fact, I didn't everything is automated; I love that repo. Someone else asked for help, it wasn't mine.  THANK YOU, I don't know why. But I'm feeling good today. Hope you also have a good day.  
> **username_0**: @VojtěchStrnad and you didn't get mad like some other nerdies setting in the basement.  

---

## 1 answers

### Answer by username_0 on 2024-09-26. Score: 0 | Accepted answer

Fellow person with the same problem.

If you're building while not following the provided documentation at [bitcoin/doc/build\_windows.md](https://github.com/bitcoin/bitcoin/blob/d3a352256064d62a3e2e2d054ffa0faecb49dd71/doc/build-windows.md) or any platform whatsoever. You should follow whatever instructions are given in [bitcoin/doc](https://github.com/bitcoin/bitcoin/tree/d3a352256064d62a3e2e2d054ffa0faecb49dd71/doc). You'll need `cmake` and `libtool-bin` and execute any libtool commands given as warnings during dependency build or you'll have to juggle (I don't know what this word means) errors.


---

