When you say:
#include <cstring>
the g++ compiler should put the <string.h>
declarations it itself includes into the std::
AND the global namespaces. It looks for some reason as if it is not doing that. Try replacing one instance of strcpy
with std::strcpy
and see if that fixes the problem.