I #include <string.h> but when I call strcasestr(src, search); I get the following error message implicit declaration of function ‘strcasestr’. how to I compile: gcc-4.6 -Wall -lsqlite3 -lunac -Werror -O2 -o foo.out foo.c how to fix this? Thanks in advance.
I #include <string.h> but when I call strcasestr(src, search); I get the following error
Share
As specified in the corresponding manpage, since
strcasestris a nonstandard extension you must#define _GNU_SOURCEbefore thebefore 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_SOURCEon the compiler command line.