include unistd.h for getopt handling.
diff --git a/setconsole.c b/setconsole.c
index b0ce13f..9285aa8 100644
--- a/setconsole.c
+++ b/setconsole.c
@@ -6,6 +6,7 @@
 #include <linux/vt.h>
 #include <errno.h>
 #include <pthread.h>
+#include <unistd.h>
 
 static int activate_thread_switch_vc;
 static void *activate_thread(void *arg)