When using C functions from a C++ program, include headers as in the following example:
extern "C" { #include <string.h> }