--- a/libupnpp/discovery.cxx
+++ b/libupnpp/discovery.cxx
@@ -18,6 +18,7 @@
 
 #include <stdlib.h>
 #include <errno.h>
+#include <unistd.h>
 
 #include <iostream>
 #include <map>