diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c
index ab0d76e91d0..b96d78e8c17 100644
--- a/mysys/my_symlink.c
+++ b/mysys/my_symlink.c
@@ -23,6 +23,7 @@
 #include <sys/param.h>
 #include <sys/stat.h>
 #endif
+#include <my_dir.h>
 
 /*
   Reads the content of a symbolic link