lua_getfield(L, -1, "x") <== push mytable["x"],作用同下面两行调用 --lua_pushstring(L, "x") <== push key "x" --lua_gettable(L,-2) <== pop key "x", push mytable["x"] lua_setfield必须为字符串键 lua_getglobal(L, "mytable") <== push mytable lua_pushstring(L, "abc") <== push value "abc" lua_set...
/tmp/cc3ZTxHW.ltrans0.ltrans.o: In functionlstop': <artificial>:(.text+0xb98): undefined reference tolua_sethook' :(.text+0xba8): undefined reference toluaL_error' /tmp/cc3ZTxHW.ltrans0.ltrans.o: In functionmain': :(.text.startup+0x10): undefined reference toluaL_newstate' <ar...