diff --git a/utils/nfc-read-forum-tag3.c b/utils/nfc-read-forum-tag3.c
index f522727..643e5f4 100644
--- a/utils/nfc-read-forum-tag3.c
+++ b/utils/nfc-read-forum-tag3.c
@@ -55,6 +55,10 @@
 
 #include "nfc-utils.h"
 
+#if defined(WIN32) && defined(__GNUC__) /* mingw compiler */
+ #include <getopt.h>
+#endif
+
 static nfc_device *pnd;
 
 static void