Implicit declaration of function ‘str[n]casecmp’ [-Werror=implicit-function-declaration]
c, c99, gcc
Solution
These functions are declared in `strings.h`, not `string.h`.
Problem
I am compiling a C library, using C99. I am including string.h to my translation unit (and I can navigate to the definitions of the str?casecmp functions in my NetBeans IDE. The source looks something like this: ``` #include <string.h> int foo(char* c1, char* c2) { return strcasecmp(c1, c2); } int foobar(char* c1, char* c2, int n) { return strncasecmp(c1, c2, n); } ``` However, when I attempt to compile, I get the error shown in the title. I am using GCC version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5). This is what my gcc command looks like: ``` gcc -c -g -Werror -DE4C_THREADSAFE -DLINUX_BUILD -I../include -I../genutils -std=c99 -fPIC -MMD -MP -MF build/Debug/GNU-Linux-x86/btypes.o.d -o build/Debug/GNU-Linux-x86/btypes.o btypes.c ``` What is causing this, and how do I fix it?