<p>hi everyone so i tried compiling bitcoin using the cmake but i keep having issues with the compilation i keep getting this error:</p>
<pre><code>26%] Built target leveldb
In file included from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/uint256.h:11,
                 from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/crypto/muhash.h:9,
                 from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/crypto/muhash.cpp:5:
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h: In function ‘constexpr auto util::hex_literals::operator&quot;&quot;_hex_u8()’:
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h:434:50: error: ‘bit_cast’ is not a member of ‘std’; did you mean ‘bad_cast’?
  434 | constexpr auto operator&quot;&quot;_hex_u8() { return std::bit_cast&lt;std::array&lt;uint8_t, str.bytes.size()&gt;&gt;(str.bytes); }
      |                                                  ^~~~~~~~
      |                                                  bad_cast
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h:434:95: error: expected primary-expression before ‘&gt;’ token
  434 | constexpr auto operator&quot;&quot;_hex_u8() { return std::bit_cast&lt;std::array&lt;uint8_t, str.bytes.size()&gt;&gt;(str.bytes); }
      |                                                                                               ^~
In file included from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/uint256.h:11,
                 from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/crypto/siphash.h:11,
                 from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/crypto/siphash.cpp:5:
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h: In function ‘constexpr auto util::hex_literals::operator&quot;&quot;_hex_u8()’:
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h:434:50: error: ‘bit_cast’ is not a member of ‘std’; did you mean ‘bad_cast’?
  434 | constexpr auto operator&quot;&quot;_hex_u8() { return std::bit_cast&lt;std::array&lt;uint8_t, str.bytes.size()&gt;&gt;(str.bytes); }
      |                                                  ^~~~~~~~
      |                                                  bad_cast
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h:434:95: error: expected primary-expression before ‘&gt;’ token
  434 | constexpr auto operator&quot;&quot;_hex_u8() { return std::bit_cast&lt;std::array&lt;uint8_t, str.bytes.size()&gt;&gt;(str.bytes); }
      |                                                                                               ^~
make[2]: *** [src/crypto/CMakeFiles/bitcoin_crypto.dir/build.make:174: src/crypto/CMakeFiles/bitcoin_crypto.dir/muhash.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/crypto/CMakeFiles/bitcoin_crypto.dir/build.make:286: src/crypto/CMakeFiles/bitcoin_crypto.dir/siphash.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:830: src/crypto/CMakeFiles/bitcoin_crypto.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
</code></pre>

CC BY-SA 4.0
2024-12-29T14:18:27.810Z
What compiler are you using? Bitcoin Core (as of version 28.0) needs clang 16 (or later) or GCC 11.1 (or later).
Pieter Wuille
CC BY-SA 4.0
2024-12-31T16:57:52.313Z
hi thanks for responding i am using the version that uses the make to build
Jidinen 
CC BY-SA 4.0
2024-12-31T18:24:02.137Z
`make` will use your system's default compiler, on Linux systems that is normally `gcc`. Type `gcc --version` to find out its version. You may need to install a more modern compiler, or upgrade your operating system.
Pieter Wuille
CC BY-SA 4.0
2024-12-31T19:24:16.427Z
I am using WSL for some reason I can't put another os on my PC because of the bios password and I think clang 16 isn't available for WSL but gcc 13 but errors keep popping up during the build
Jidinen 
<compiling>
Bitcoin compilation keeps failing
Jidinen 
# Bitcoin compilation keeps failing

(Asked by: username_0 on 2024-12-29)

hi everyone so i tried compiling bitcoin using the cmake but i keep having issues with the compilation i keep getting this error:
26%] Built target leveldb
In file included from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/uint256.h:11,
                 from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/crypto/muhash.h:9,
                 from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/crypto/muhash.cpp:5:
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h: In function ‘constexpr auto util::hex_literals::operator""_hex_u8()’:
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h:434:50: error: ‘bit_cast’ is not a member of ‘std’; did you mean ‘bad_cast’?
  434 | constexpr auto operator""_hex_u8() { return std::bit_cast>(str.bytes); }
      |                                                  ^~~~~~~~
      |                                                  bad_cast
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h:434:95: error: expected primary-expression before ‘>’ token
  434 | constexpr auto operator""_hex_u8() { return std::bit_cast>(str.bytes); }
      |                                                                                               ^~
In file included from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/uint256.h:11,
                 from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/crypto/siphash.h:11,
                 from /home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/crypto/siphash.cpp:5:
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h: In function ‘constexpr auto util::hex_literals::operator""_hex_u8()’:
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h:434:50: error: ‘bit_cast’ is not a member of ‘std’; did you mean ‘bad_cast’?
  434 | constexpr auto operator""_hex_u8() { return std::bit_cast>(str.bytes); }
      |                                                  ^~~~~~~~
      |                                                  bad_cast
/home/a24_lynx/bitcoin-core-test-the-test-jidinen/bitcoin/src/util/strencodings.h:434:95: error: expected primary-expression before ‘>’ token
  434 | constexpr auto operator""_hex_u8() { return std::bit_cast>(str.bytes); }
      |                                                                                               ^~
make[2]: *** [src/crypto/CMakeFiles/bitcoin_crypto.dir/build.make:174: src/crypto/CMakeFiles/bitcoin_crypto.dir/muhash.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/crypto/CMakeFiles/bitcoin_crypto.dir/build.make:286: src/crypto/CMakeFiles/bitcoin_crypto.dir/siphash.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:830: src/crypto/CMakeFiles/bitcoin_crypto.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

**Tags:** compiling

> **Comments:**
> **username_1**: What compiler are you using? Bitcoin Core (as of version 28.0) needs clang 16 (or later) or GCC 11.1 (or later).  
> **username_0**: hi thanks for responding i am using the version that uses the make to build  
> **username_1**: `make` will use your system's default compiler, on Linux systems that is normally `gcc`. Type `gcc --version` to find out its version. You may need to install a more modern compiler, or upgrade your operating system.  
> **username_0**: I am using WSL for some reason I can't put another os on my PC because of the bios password and I think clang 16 isn't available for WSL but gcc 13 but errors keep popping up during the build  

---

## 0 answers

