diff --git a/externals/fluid~/fluid~.c b/externals/fluid~/fluid~.c
index f04862aa1f8e13f00d3511fe78e1d06270672f0a..7068e7ba9681c99ab077a3f34ec2a37032f986d7 100644
--- a/externals/fluid~/fluid~.c
+++ b/externals/fluid~/fluid~.c
@@ -8,6 +8,8 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <fcntl.h>
+// needed to get S_IRUSR etc. in msys2
+#include <sys/stat.h>
 
 #include "m_pd.h"