这是我的 dev-cpp 编译器日志:
rm -f main.o luaTest.exe'
gcc.exe -c main.c -o main.o -I"E:/Dev-Cpp/include" -I"E:/Lua/5.1/include"'
gcc.exe main.o -o "luaTest.exe" -L"E:/Dev-Cpp/lib" -L "E:/lua/5.1/lua5.1.lib"'
main.o(.text+0x34):main.c: undefined reference to 'luaL_newstate'
main.o(.text+0x48):main.c: undefined reference to 'luaL_openlibs'
main.o(.text+0xab):main.c: undefined reference to 'luaL_loadbuffer'
main.o(.text+0xd5):main.c: undefined reference to 'lua_pcall'
main.o(.text+0x11c):main.c: undefined reference to 'lua_tolstring'
main.o(.text+0x14e):main.c: undefined reference to 'lua_settop'
main.o(.text+0x161):main.c: undefined reference to 'lua_close'
collect2: ld returned 1 exit status'
make.exe: *** [luaTest.exe] Error 1'
我可以用 code::blocks 编译和链接我的代码成功。我无法弄清楚 dev-cpp 有什么问题。