将https://github.com/tronkko/dirent,下的include的dirent.h拷贝到当前工程的目录下。
在这个工程中,将directory字符串转换为宽字节的时候,如果目录是汉字的时候会出现问题。
解决方法:
#include <locale.h>
#if defined(_MSC_VER) && _MSC_VER >= 1400
/* Microsoft Visual Studio 2005 or later */
setlocale(LC_ALL,"chs");
error = mbstowcs_s(pReturnValue, wcstr, sizeInWords, mbstr, count);