diff --git a/include/opendht/rng.h b/include/opendht/rng.h
index 93dbe927d7b9e5784170db7a4eda4666d70f8af1..f4fff51e4ca3b418895a344369d7291afec08aa6 100644
--- a/include/opendht/rng.h
+++ b/include/opendht/rng.h
@@ -21,6 +21,7 @@
 
 #include <random>
 #include <algorithm>
+#include <functional>
 
 namespace dht {
 namespace crypto {