--- a/libupnpp/cdirectory.cxx
+++ b/libupnpp/cdirectory.cxx
@@ -15,6 +15,7 @@
  *	 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 #include <stdio.h>
+#include <stdlib.h>
 
 #include <string>
 #include <iostream>