每當我運行該程序時,它都不會向控制檯輸出任何內容。 這工作正常,如果我不使用一個類,只是在main()中完成。 當我把它放在課堂上時,我開始有問題。 我在做什麼錯? using namespace luabridge;
myClass::myClass()
{
lua_State* L = luaL_newstate();
luaL_openlibs(L);
g
考慮下面的例子: function Process()
local Container=NewContainer()
Container:On(EventType.Add,function()
Container:DoSomething()
end)
-- Does not Garbage Collect
end
在luabridge,我存
我想創建一個簡單的類與成員函數,將打印出一些成員的值,但我收到錯誤,當我嘗試引用'自我': attempt to index global 'self' (a nil value)
這裏是我試圖運行腳本: Test = {}
function Test:new()
T = {}
setmetatable(T, self)
self.__index = self
我想通過基類指針從C++傳遞到Lua使用LuaBridge的對象。派生類和基類都已正確註冊到LuaBridge。 在C++方面: // Assume both Foo and FooBase are registered properly with LuaBridge,
// exposing the a, b, and c properties
struct FooBase
{