--- a/sim/ucsim/cmd.src/cmdlex.cc
+++ b/sim/ucsim/cmd.src/cmdlex.cc
@@ -85,6 +85,7 @@
 #include <errno.h>
 #include <cstdlib>
 #include <cstring>
+#include <cstdio>
 /* end standard C++ headers. */
 
 #ifdef __cplusplus
