--- a/main.c
+++ b/main.c
@@ -18,6 +18,7 @@
 #include <unistd.h>
 #if defined(__linux__) || defined(__CYGWIN__)
 #include <pty.h>
+#include <utmp.h>
 #elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
 #include <util.h>
 #else
