lua调用C++
2021-01-15 12:12
标签:cal get 生成 create 资料 pkg ++ hello creat 根据pkg文件生成.h文件: 运行结果: Lua代码: for i=1,20 do print(); lua调用C++ 标签:cal get 生成 create 资料 pkg ++ hello creat 原文地址:https://www.cnblogs.com/Ivanhan2019/p/12936867.html
tolua++ -v
tolua++-1.0.92 (written by W. Celes, A. Manzur)
tolua++ -o L_CCObject.h CCObject.pkg
tolua++ -o L_CCString.h CCString.pkg
D:\hxh\bin\LUA资料\LUA\luatest\luatest>callTest toluatest.lua
8 3 4 9 8 0 5 1 3 0 7 4 2 1 9 0 3 6 1 6
你是:Ivan?
--[[
mytest = CTest:new()
mytest:SetA(5)
mytest:SetB("Hello")
print(mytest:GetA())
print(mytest:GetB())
mytest:delete()
]]
--local rnd = SIX_Utility:new():RNDNUM(0,9)
local rnd = SIX_Utility:GetInstance():RNDNUM(0,9)
io.write(rnd," ")
end
local s = CCString:create("你是:".."Ivan?")
local s1 = SIX_Utility:GetInstance():U2G(s:getCString())
print(s1)
上一篇:enum枚举
下一篇:并发编程三、线程可见性的底层原理