diff --git a/src/xkbcomp/include.c b/src/xkbcomp/include.c
index dc3f1e4..3e8f1da 100644
--- a/src/xkbcomp/include.c
+++ b/src/xkbcomp/include.c
@@ -50,6 +50,7 @@
 #include <errno.h>
 #include <limits.h>
 #include <stdio.h>
+#include <string.h>
 
 #include "xkbcomp-priv.h"
 #include "include.h"
@@ -234,6 +235,8 @@ FindFileInXkbPath(struct xkb_context *ctx, const char *name,
         file = fopen(buf, "r");
         if (file)
             break;
+        else if (errno != ENOENT)
+            log_err(ctx, "Couldn't open file \"%s\": %s\n", buf, strerror(errno));
     }
 
     if (!file) {
