--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -29,6 +29,10 @@
 #endif
 #include <sys/stat.h>
 
+#ifdef __ANDROID__
+#include <getopt.h>
+#endif
+
 #ifdef HAVE_LIBREADLINE
 #include <readline/readline.h>
 #include <readline/history.h>
