diff --git a/src/data/memory_chunk.h b/src/data/memory_chunk.h
index 0635349..0a1456e 100644
--- a/src/data/memory_chunk.h
+++ b/src/data/memory_chunk.h
@@ -39,6 +39,7 @@
 
 #include <inttypes.h>
 #include <sys/mman.h>
+#include <cstddef>
 
 namespace torrent {
 
diff --git a/src/torrent/common.h b/src/torrent/common.h
index 4ed250f..b7d7b7b 100644
--- a/src/torrent/common.h
+++ b/src/torrent/common.h
@@ -38,6 +38,7 @@
 #define LIBTORRENT_COMMON_H
 
 #include <inttypes.h>
+#include <cstddef>
 
 struct sockaddr;
 
