diff --git a/qemu-common.h b/qemu-common.h index 5e87bdf..9ac15ba 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -23,6 +23,9 @@ typedef struct Monitor Monitor;  #include <stdlib.h>  #include <stdio.h>  #include <stdarg.h>
+#ifdef CONFIG_CURSES
+#include <curses.h>
+#endif
 #include <stdbool.h>
 #include <string.h>
 #include <strings.h>
diff --git a/console.h b/console.h
index 9c1487e..3327c43 100644
--- a/console.h
+++ b/console.h
@@ -329,7 +329,6 @@ static inline int ds_get_bytes_per_pixel(DisplayState *ds)  }
 
 #ifdef CONFIG_CURSES
-#include <curses.h>
 typedef chtype console_ch_t;
 #else
 typedef unsigned long console_ch_t;
--
1.7.4.1
