diff --git a/include/opendht/infohash.h b/include/opendht/infohash.h
index 7ea53b3d3556db0a2b3d3b63aca676b50a2b3c8d..6f926a4b4830825cbe136e28dc9065e57047e095 100644
--- a/include/opendht/infohash.h
+++ b/include/opendht/infohash.h
@@ -44,6 +44,7 @@ typedef uint16_t in_port_t;
 #include <stdexcept>
 #include <sstream>
 #include <cstring>
+#include <cstddef>
 
 namespace dht {