I #include
but when I call strcasestr(src, search);
I get the following error message implicit declaration of function ‘strcases
As specified in the corresponding manpage, since strcasestr
is a nonstandard extension you must #define _GNU_SOURCE
before the before any #include <string.h>
#include
(other files may already include <string.h>
, thanks @Cubbi for pointing out this potential problem); this can also easily be accomplished by specifying -D_GNU_SOURCE
on the compiler command line.
You must add:
#define _GNU_SOURCE
before the string.h
include, since the function is non-standard.