0
votes

I'm trying to build a C program with Windows gcc using Mingw-w64 installation (gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0).

I get undefined reference to `memmem' error. Isn't memmem() a standard glibc function that should be available in all gcc versions?

1
with what command line(s)?underscore_d
C:/My/Programs/Mingw-w64/mingw64/bin/gcc.exe -g C:\My\Code\Tests\GCCWinCTest\main.c -o C:\My\Code\Tests\GCCWinCTest\main.exejackhab
Does this answer your question? Standard C library in mingWunderscore_d

1 Answers

2
votes

As this post explains

"MinGW does not build against glibc, it builds against msvcrt. As such, it uses libmsvcrtXX.a instead." "gcc and glibc are two separate products."

So, yep, no memmem on Windows and here's the implementation.