diff --git a/src/address.cpp b/src/address.cpp
index 453ad42..9f4cf46 100644
--- a/src/address.cpp
+++ b/src/address.cpp
@@ -28,6 +28,8 @@
 #include <arpa/inet.h>
 
 #include <cstdio>
+#include <cstring>
+#include <cstdlib>
 
 base_stream &operator << (base_stream &os, const inet6_addr &addr) {
 	os.commit_change(addr.print_string(os.req_buffer(64), 64));
diff --git a/include/mrd/address.h b/include/mrd/address.h
index 80c8e45..1d2a495 100644
--- a/include/mrd/address.h
+++ b/include/mrd/address.h
@@ -31,6 +31,7 @@
 #include <map>
 #include <string>
 #include <vector>
+#include <cstring>
 
 class base_stream;
 
