0

これは私の 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 の何が問題なのかわかりません。

4

2 に答える 2

0

リンクのステップが見えません。オプション-L(大文字の L) は、(小文字の L) を介して参照されるライブラリの検索ディレクトリを設定します-l。最後のステップでは、正しい の代わりにlua5.1.libusingへのリンクを試みます。-L-l

于 2011-11-18T23:48:14.410 に答える