From af9da7db81cbc28e8f13e7cff683a0218a259881 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sun, 30 Aug 2026 22:38:47 +0200 Subject: [PATCH] fix: diagnostics.hpp must include , not hope for it NetworkSnapshot declares std::vector and std::vector, and the header has never included . It compiles anyway wherever something earlier in the translation unit drags the definition in, which is every build we have done -- and does not compile where nothing does. Found by a consumer, in CI, on Debian 12 / GCC 12: a header that includes before gets "'vector' in namespace 'std' does not name a template type" at the two member declarations, and then one cascading error for every use of .nodes or .channels downstream. The reported errors all name the consumer's file, so the bug reads as the consumer's until you look at the first line of the compiler output. Nothing else in the header is missing: it uses std::atomic, std::chrono, std::size_t and std::string, and includes all four. Checked the rest of the public headers the same way while here, by compiling each one standalone under GCC 12. Two other results, neither fixed by this commit: network.hpp names IChannelProbe (channel.hpp:557) without including channel.hpp -- the same class of bug, still latent. web_debug.hpp needs httplib.h, which is an external optional dependency and not a defect. --- include/kpn/diagnostics.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/kpn/diagnostics.hpp b/include/kpn/diagnostics.hpp index 884d668..f760c81 100644 --- a/include/kpn/diagnostics.hpp +++ b/include/kpn/diagnostics.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include // clock_gettime, CLOCK_THREAD_CPUTIME_ID namespace kpn {