fnmatch.h not found on MINGW64

Ryan Long ryan.long at oarcorp.com
Tue Aug 23 19:53:45 UTC 2022


When I try to include fnmatch.h, I'm getting the following error when 
using x86_64-w64-mingw32-gcc or gcc, I'm getting the following error. I 
have to manually include /usr/include with -I. Does anyone know a way to 
fix this?

Thanks,

Ryan


Using built-in specs.^M
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe^M
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/lto-wrapper.exe^M
Target: x86_64-w64-mingw32^M
Configured with: ../gcc-10.3.0/configure --prefix=/mingw64 
--with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 
--with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include 
--libexecdir=/mingw64/lib --enable-bootstrap --enable-checking=release 
--with-arch=x86-64 --with-tune=generic 
--enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit 
--enable-shared --enable-static --enable-libatomic 
--enable-threads=posix --enable-graphite --enable-fully-dynamic-string 
--enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes 
--disable-libstdcxx-pch --disable-libstdcxx-debug --enable-lto 
--enable-libgomp --disable-multilib --disable-rpath 
--disable-win32-registry --disable-nls --disable-werror 
--disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 
--with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 
--with-pkgversion='Rev5, Built by MSYS2 project' 
--with-bugurl=https://github.com/msys2/MINGW-packages/issues 
--with-gnu-as --with-gnu-ld --with-boot-ldflags='-pipe 
-Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high 
-Wl,--disable-dynamicbase -static-libstdc++ -static-libgcc' 
'LDFLAGS_FOR_TARGET=-pipe 
-Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high' 
--enable-linker-plugin-flags='LDFLAGS=-static-libstdc++\ -static-libgcc\ 
-pipe\ 
-Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high\ 
-Wl,--stack,12582912'^M
Thread model: posix^M
Supported LTO compression algorithms: zlib zstd^M
gcc version 10.3.0 (Rev5, Built by MSYS2 project) ^M
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'^M
  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/cc1.exe 
-quiet -v -iprefix 
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/ -D_REENTRANT 
test.c -quiet -dumpbase test.c -mtune=generic -march=x86-64 -auxbase 
test -version -o C:\msys64\tmp\cc6pmIhu.s^M
GNU C17 (Rev5, Built by MSYS2 project) version 10.3.0 (x86_64-w64-mingw32)^M
         compiled by GNU C version 10.3.0, GMP version 6.2.1, MPFR 
version 4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP^M
^M
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072^M
ignoring duplicate directory 
"C:/msys64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/10.3.0/include"^M
ignoring nonexistent directory "D:/a/_temp/msys/msys64/mingw64/include"^M
ignoring nonexistent directory "/mingw64/include"^M
ignoring duplicate directory 
"C:/msys64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/10.3.0/include-fixed"^M
ignoring duplicate directory 
"C:/msys64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/include"^M
ignoring nonexistent directory 
"D:/a/_temp/msys/msys64/mingw64/x86_64-w64-mingw32/include"^M
#include "..." search starts here:^M
#include <...> search starts here:^M
  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/include^M
  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../include^M
  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/include-fixed^M
  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/include^M
End of search list.^M
GNU C17 (Rev5, Built by MSYS2 project) version 10.3.0 (x86_64-w64-mingw32)^M
         compiled by GN
^M
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072^M
Compiler executable checksum: 9904f531f084fcea0470441e88ced2da^M
test.c:1:10: fatal error: fnmatch.h: No such file or directory
     1 | #include <fnmatch.h>
       |          ^~~~~~~~~~~
compilation terminated.^M


More information about the devel mailing list