codeblocks使用的minGW沿用linux习惯,strlen声明放在 string.h 中(linux系统中可以通过man strlen来查看其帮助和所在头文件),仅仅 #include <string> 只是引入了 std::string,还需要 #include <string.h>