--- a/tagutils/tagutils.h
+++ b/tagutils/tagutils.h
@@ -30,6 +30,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <libgen.h>
 
 #define ROLE_NOUSE 0
 #define ROLE_START 1