标签:
转自http://blog.163.com/lvan100@yeah/blog/static/68117214201249113216137/
lapi.c lapi.h lcode.c lcode.h lctype.c lctype.h ldebug.c ldebug.h ldo.c ldo.h ldump.c lfunc.c lfunc.h lgc.c lgc.h llex.c llex.h llimits.h lmem.c lmem.h lobject.c lobject.h lopcodes.c lopcodes.h lparser.c lparser.h lstate.c lstate.h lstring.c lstring.h ltable.c ltable.h ltm.c ltm.h lua.h luaconf.h lundump.c lundump.h lvm.c lvm.h lzio.c lzio.h
lauxlib.c lauxlib.h lbaselib.c lbitlib.c lcorolib.c ldblib.c linit.c liolib.c lmathlib.c loadlib.c loslib.c lstrlib.c ltablib.c lua.h luaconf.h lualib.h
lauxlib.h Lua.c lua.h luaconf.h lualib.h
lauxlib.h ldebug.h llimits.h lmem.h lobject.h lopcodes.h lstate.h ltm.h lua.h Luac.c luaconf.h lundump.h lzio.h
DEBUG:$(OutDir)\..\..\Bin\VS2008\Debug\$(ProjectName).lib
RELEASE:$(OutDir)\..\..\Bin\VS2008\Release\$(ProjectName).lib
修改Lua、LuaC工程的输出目录为
DEBUG: $(OutDir)\..\..\Bin\VS2008\Debug\$(ProjectName).exe
RELEASE:$(OutDir)\..\..\Bin\VS2008\Release\$(ProjectName).exe
DEBUG: ..\..\Bin\VS2008\Debug\Core.lib
..\..\Bin\VS2008\Debug\Standard.lib
RELEASE: ..\..\Bin\VS2008\Release\Core.lib
..\..\Bin\VS2008\Release\Standard.lib
#define LUA_COMPAT_ALL
--testP.lua:
pack = require "mypack" --导入包
print(ver or "No ver defined!")
print(pack.ver)
print(aFunInMyPack or "No aFunInMyPack defined!")
pack.aFunInMyPack()
print(aFuncFromMyPack or "No aFuncFromMyPack defined!")
aFuncFromMyPack()
--mypack.lua:
module(..., package.seeall) --定义包
ver = "0.1 alpha"
function aFunInMyPack()
print("Hello!")
end
_G.aFuncFromMyPack = aFunInMyPack
No ver defined!
0.1 alpha
No aFunInMyPack defined!
Hello!
function: 00387EA8
Hello!
那么恭喜你,成功了!
标签:
原文地址:http://www.cnblogs.com/gamekk/p/4521088.html