https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61889
--- Comment #36 from Kai Tietz <ktietz at gcc dot gnu.org> --- Well, I guess that you missed to reconfigure gcc. By checking current source is the include of ftw.h guarded by HAVE_FTW_H check, which get defined by configure if header is found.