Questions tagged [luabind]

Library to make bindings between C++ and Lua

Luabind is a library that helps you create bindings between C++ and Lua. It has the ability to expose functions and classes, written in C++, to Lua. It will also supply the functionality to define classes in lua and let them derive from other lua classes or C++ classes. Lua classes can override virtual functions from their C++ baseclasses. It is written towards Lua 5.x, and does not work with Lua 4.

177 questions
0
votes
0 answers

How to use boost::any type in luabind (lua, c++)?

In c++, i have a function that return boost::any type , in Lua i called this function (throught luabind) but get error "crep && you are trying to use an unregistered type" I used : lua 5.1.5, luabind 0.8
adorzhang
  • 1
  • 2
0
votes
1 answer

how do i iterate the tables parameters which is present under the main table?

In lua ,im calling a function which returns a table variable that contains many parameter internally..but when i get that value i couldnt access the paramter which is present in the table. I can see the tables parameter in the original function in…
user748765
  • 21
  • 1
  • 2
0
votes
3 answers

Open ready-made Lua files

I am new to the Lua language. . . I have some ready made .lua source files. Now I want to edit it and also want to modify it. First, I want to open and see it. I have searched on net, and found that it may be opened in Notepad, but when I open it…
user644458
0
votes
2 answers

when do luabind free created objects?

I'm having problems with luabind. I define a std::map to allocate objects created in lua. I publish this map as a global object in lua in this way: luabind::globals(L)["g_SceneManager2D"] = this; After that, this object is used into a function into…
Killrazor
  • 6,856
  • 15
  • 53
  • 69
0
votes
1 answer

How make luabind work in ubuntu?

I've been trying the hello world example of Luabind in Ubuntu, but I cannot make it work. Would anyone know how to make this example work in Ubuntu using g++? kuyu@castor-ub:~/dkuyu/Dropbox/practice/lua/luabind$ cat hellobind.cpp #include…
hermit.crab
  • 852
  • 1
  • 8
  • 20
0
votes
1 answer

Can't load shared library (compiled with C++ and Luabind) package into Lua

I have compiled the shared library for the "basic usage" example from the Luabind docs. However, I can't get it to call from Lua. lbtest.cpp extern "C" { #include "lua.h" } #include #include void greet() { …
marcman
  • 3,233
  • 4
  • 36
  • 71
0
votes
0 answers

Multiple Lua environments issue

I'm having trouble on creating multiple Lua environments to run multiple similar scripts in the same lua_State. The program crashes with the following error PANIC: unprotected error in call to Lua API (attempt to index a nil value) Here's the…
dcubix
  • 187
  • 2
  • 10
0
votes
0 answers

Luabind - return userdata from script

So after struggling a bit, I have decided to give Luabind a try. I'm currently in the process of figuring things out and currently, my biggest problem is returning userdata (class) created by the lua script. This is the example which I'm working…
prkist
  • 431
  • 5
  • 13
0
votes
1 answer

How to override luabind class __finalize method?

How to override luabind class __finalize method? Trying to do this in such way: class A function A:__init() end function A:__finalize() end local original_finalize_function = A.__finalize A.__finalize = function(...) -- some custom logic if…
kFk
  • 409
  • 6
  • 13
0
votes
1 answer

How to bind a raw pointer with Luabind

I'm attempting to use luabind to bind box2d so that I can use it within my lua scripts. I've hit a problem where I cant seem to bind raw pointers with luabind. Below is my code: luabind::module(luaState)[ …
Sun
  • 2,658
  • 6
  • 28
  • 33
0
votes
1 answer

Generic types with c++ and lua

I have an Entity class that contains some attributes (pieces of data). These attributes are stored in a map from name => value. class Entity { public: // Sets the attribute with the specified name. void attribute(const std::string& name,…
Homar
  • 1,520
  • 2
  • 17
  • 26
0
votes
1 answer

Luabind compile time error Unable to deduce template argument

I'm getting a list of compile time errors that I don't understand. I'm using the luabind library from sourceforge, version 0.9.1, and I'm trying to bind functions from MyGUI, I'm using Visual Studio 2012, and Lua 5.1. The errors come up during the…
Jake Kiesel
  • 341
  • 4
  • 10
0
votes
1 answer

Instantiate lua classes using Luabind

Is it possible to instantiate Lua "classes" using Luabind from a c++ application? To illustrate the problem, consider the following simple Lua script: class "Person" function Person:__init(name) self.name = name end function Person:display() …
Homar
  • 1,520
  • 2
  • 17
  • 26
0
votes
1 answer

Lua with Luabind compilation error c++

I can't get it to work. Here is my code, I kept it as simple as possible : #include #include #include #include class MyClass { public: MyClass() {} ~MyClass() {} …
Sw0ut
  • 741
  • 2
  • 9
  • 29
0
votes
1 answer

How do I use Luabind and C++ to create an asset managing class?

I've made countless attempts to get this working, but everything I do gives me run-time errors. I've been trying to make asset managers to manage content for my game engine, and I'm using lua and luabind for my scripting. Getting everything to…
NSDuo
  • 1