Skip to content

build: fix compilation on modern toolchains using ai#327

Open
pppest wants to merge 1 commit into
devaultcrypto:developfrom
pppest:fix/modern-toolchain-build
Open

build: fix compilation on modern toolchains using ai#327
pppest wants to merge 1 commit into
devaultcrypto:developfrom
pppest:fix/modern-toolchain-build

Conversation

@pppest
Copy link
Copy Markdown
Contributor

@pppest pppest commented May 17, 2026

used ai to fix build errors, ai slob below:

build: fix compilation on modern toolchains (GCC 13+, CMake 4, miniupc 2.3)

The 2019-era code no longer builds on current Linux toolchains. Changes:

  • CMakeLists.txt: set CMAKE_POLICY_VERSION_MINIMUM=3.5 so bundled subprojects (bls, secp256k1, leveldb, univalue, qt) that declare cmake_minimum_required(<3.5) still configure under CMake 4.x, which removed that compatibility.

  • src/compat/modern_prelude.h (new) + force-include via CMakeLists.txt: modern libstdc++ (GCC 13+) no longer transitively pulls in , , container headers, etc. A small force-included prelude fixes this tree-wide instead of editing hundreds of files.

  • cmake/modules/FindBerkeleyDB.cmake: also search db5.x include path suffixes and version-suffixed library names (libdb_cxx-5.3), as used by current distros.

  • cmake/modules/FindMiniupnpc.cmake: prepend stddef.h to the header self-compile check. miniupnpc 2.3.x headers reference size_t without including it, which otherwise wrongly marked miniupnpc as missing and broke linking.

  • src/net.cpp: use the 7-argument UPNP_GetValidIGD signature (added wanaddr/wanaddrlen) for MINIUPNPC_API_VERSION >= 18.

  • src/support/lockedpool.cpp, src/validation.cpp: add explicit standard includes that were previously available only transitively.

Result: a clean cmake .. && make builds devaultd, devault-cli, devault-tx and devault-qt with no extra flags.

…npc 2.3)

The 2019-era code no longer builds on current Linux toolchains. Changes:

* CMakeLists.txt: set CMAKE_POLICY_VERSION_MINIMUM=3.5 so bundled
  subprojects (bls, secp256k1, leveldb, univalue, qt) that declare
  cmake_minimum_required(<3.5) still configure under CMake 4.x, which
  removed that compatibility.

* src/compat/modern_prelude.h (new) + force-include via CMakeLists.txt:
  modern libstdc++ (GCC 13+) no longer transitively pulls in <cstdint>,
  <stdexcept>, container headers, etc. A small force-included prelude
  fixes this tree-wide instead of editing hundreds of files.

* cmake/modules/FindBerkeleyDB.cmake: also search db5.x include path
  suffixes and version-suffixed library names (libdb_cxx-5.3), as used
  by current distros.

* cmake/modules/FindMiniupnpc.cmake: prepend stddef.h to the header
  self-compile check. miniupnpc 2.3.x headers reference size_t without
  including it, which otherwise wrongly marked miniupnpc as missing and
  broke linking.

* src/net.cpp: use the 7-argument UPNP_GetValidIGD signature (added
  wanaddr/wanaddrlen) for MINIUPNPC_API_VERSION >= 18.

* src/support/lockedpool.cpp, src/validation.cpp: add explicit standard
  includes that were previously available only transitively.

Result: a clean `cmake .. && make` builds devaultd, devault-cli,
devault-tx and devault-qt with no extra flags.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant