<p>The issue is the with the clang compiler. Use gcc as the compiler to build the code.
Install gcc from homebrew and then build the code with the following command specifying the path of the compiler to be used.</p>
<pre><code>cmake -B build -DCMAKE_C_COMPILER=/opt/homebrew/bin/gcc-14 -DCMAKE_CXX_COMPILER=/opt/homebrew/bin/g++-14 \
    -DBUILD_GUI=OFF -DWITH_BDB=OFF -DBUILD_BENCH=OFF -DBUILD_FOR_FUZZING=OFF -DBUILD_KERNEL_LIB=OFF \
    -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_TX=OFF -DBUILD_UTIL=OFF -DBUILD_WALLET_TOOL=OFF
</code></pre>

CC BY-SA 4.0
2024-12-09T14:03:23.933Z
2024-12-09T14:03:23.933Z
Himanshu Raheja
<p>i have bitcoin repo from tag v28.0, everytime i run <code>cmake --build build -j$(sysctl -n hw.ncpu)</code>, i keep getting the following error</p>
<pre><code>bitcoin/src/uint256.h:133:19: error: call to consteval function 'util::ConstevalHexDigit' is not a constant expression
</code></pre>
<p>am trying to setup bitcoin as part of assessment for chaincode lab BOSS program.</p>

CC BY-SA 4.0
2024-11-20T11:42:39.187Z
What compiler are you using? You need at least GCC 11.1 or Clang 16.0 to build Bitcoin Core 28.0 (see list of dependencies: https://github.com/bitcoin/bitcoin/blob/v28.0/doc/dependencies.md)
Pieter Wuille
<bitcoin-core-development><compiling>
call to consteval function 'util::ConstevalHexDigit' is not a constant expression
mubarak aminu
# call to consteval function 'util::ConstevalHexDigit' is not a constant expression

(Asked by: username_0 on 2024-11-20)

i have bitcoin repo from tag v28.0, everytime i run `cmake --build build -j$(sysctl -n hw.ncpu)`, i keep getting the following error

```
bitcoin/src/uint256.h:133:19: error: call to consteval function 'util::ConstevalHexDigit' is not a constant expression

```

am trying to setup bitcoin as part of assessment for chaincode lab BOSS program.

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

> **Comments:**
> **username_1**: What compiler are you using? You need at least GCC 11.1 or Clang 16.0 to build Bitcoin Core 28.0 (see list of dependencies: https://github.com/bitcoin/bitcoin/blob/v28.0/doc/dependencies.md)  

---

## 1 answers

### Answer by username_2 on 2024-12-09. Score: 0

The issue is the with the clang compiler. Use gcc as the compiler to build the code.
Install gcc from homebrew and then build the code with the following command specifying the path of the compiler to be used.

```
cmake -B build -DCMAKE_C_COMPILER=/opt/homebrew/bin/gcc-14 -DCMAKE_CXX_COMPILER=/opt/homebrew/bin/g++-14 \
    -DBUILD_GUI=OFF -DWITH_BDB=OFF -DBUILD_BENCH=OFF -DBUILD_FOR_FUZZING=OFF -DBUILD_KERNEL_LIB=OFF \
    -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_TX=OFF -DBUILD_UTIL=OFF -DBUILD_WALLET_TOOL=OFF

```


---

