安装完LuaForWindows_v5.1.4
打开vs
tools->options->projects->directories
executable files 选项添加lua安装以后的路径,我的是 C:\Program Files\Lua\5.1
include files选项添加lua include路径,我的是 C:\Program Files\Lua\5.1include
library files 选项添加lua lib路径,我的是 C:\Program Files\Lua\5.1\lib
然后
加入lua静态库链接
Project->setings->link->input
Additional Dependencies 选项加入 lua5.1.lib lua51.lib
其他一些问题及解决办法
1.编译报错一
Linking...
test.obj : error LNK2001: unresolved external symbol _lua_close
test.obj : error LNK2001: unresolved external symbol _lua_pcall
test.obj : error LNK2001: unresolved external symbol _luaL_loadstring
test.obj : error LNK2001: unresolved external symbol _luaopen_io
test.obj : error LNK2001: unresolved external symbol _luaopen_base
test.obj : error LNK2001: unresolved external symbol _luaL_newstate
Debug/test.exe : fatal error LNK1120: 6 unresolved e