diff --git a/src/getopt.c b/src/getopt.c
index d212b3a5ef6fbda484e1a38528f59384c2736d2b..eaae3f724a1603d4ec20b149fcc351922c4574b4 100644
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -36,6 +36,7 @@
 #endif
 
 #include <stdio.h>
+#include <string.h>
 
 /* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself.  This code is part of the GNU C