diff --git a/examples/echo/echo-client.h b/examples/echo/echo-client.h
index 54401ec..3511cc0 100644
--- a/examples/echo/echo-client.h
+++ b/examples/echo/echo-client.h
@@ -3,6 +3,7 @@
 
 #include <dbus-c++/dbus.h>
 #include "echo-client-glue.h"
+#include <cstdio>
 
 class EchoClient
 : public org::freedesktop::DBus::EchoDemo_proxy,
diff --git a/examples/echo/echo-server.h b/examples/echo/echo-server.h
index 3f0be58..9dfbaec 100644
--- a/examples/echo/echo-server.h
+++ b/examples/echo/echo-server.h
@@ -2,6 +2,7 @@
 #define __DEMO_ECHO_SERVER_H
 
 #include <dbus-c++/dbus.h>
+#include <cstdio>
 #include "echo-server-glue.h"
 
 class EchoServer
