自己的写一小段代码:
#include <stdio.h> #include <string.h> #include <lua.h> int main(int argc,char* argv[]){ lua_State* L=luaL_newstate(); char tmp[1024]; while(!feof(stdin)){ fgets(tmp,sizeof(tmp),stdin); printf("%4lu %s\n",strlen(tmp),tmp); } return 0; }
在win7 64位,mingw下编译总是报警告:
format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t' [-Wformat=] test3.c /test7/src line 18 C/C++ Problem
google了一下,试了各种方法,也无结果。
突然灵感一来,想起来mingw是32位系统,难道是因为这个原因,下载mingw64试下。
安装mingw64:http://sourceforge.net/projects/mingwbuilds/
0 条评论。