Here is my C++ main function :
int main() {
lua_State* L = luaL_newstate();
luaL_openlibs(L);
getGlobalNamespace(L).
beginNamespace("o").
beginClass<Object>("Object").
addConstructor<void (*) (double, double)>().
addProperty("width", &Object::getWidth, &Object::setWidth).
addProperty("height", &Object::getHeight, &Object::setHeight).
addProperty("x", &Object::getX, &Object::setX).
addProperty("y", &Object::getY, &Object::setY).
endClass().
endNamespace();
lua_pcall(L, 0, 0, 0);
luaL_dofile(L, "main.lua");}
And here is my main.lua for Love2D
function love.load()
obj = o.Object(10, 20) end
When i tried to run it with love it says that obj is a nil value and i realized that Love2D doesn't run my main function in C++ to create the object class. How do i call a C++ main function in Lua using LuaBridge?