luabind

error: missing binary operator before token “(”

三世轮回 提交于 2019-12-12 10:09:32
问题 after gcc upgrade my project fails to build due to the error: In file included from /usr/include/luabind/wrapper_base.hpp:31:0, from /usr/include/luabind/back_reference.hpp:27, from /usr/include/luabind/class.hpp:93, from /usr/include/luabind/luabind.hpp:28, from /home/ockonal/Workspace/themisto/engine/include/Scripting/ScriptManager.hpp:21, from /home/ockonal/Workspace/themisto/engine/source/Core/Root.cpp:28: /usr/include/luabind/detail/call_member.hpp:319:1: error: missing binary operator

Linking errors with lua & luabind - mingw

穿精又带淫゛_ 提交于 2019-12-12 03:56:37
问题 I am using luabind for binding my C++ classes to lua, I can get luabind and most lua functions to work, but if I try to use luaL_openlibs() I get: undefined reference to 'luaL_openlibs' collect2: ld returned 1 exit status if I add -llua to the linker I get: c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../liblua.a(lapi.o):lapi.c:(.text+0x15c): multiple definition of 'lua_gettop' c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../libluabindd.dll.a(d000253.o):(.text+0x0): first defined here c:/mingw

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

余生长醉 提交于 2019-12-12 03:52:28
问题 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 <iostream> #include <luabind/luabind.hpp> void greet() { std::cout << "hello world!\n"; } extern "C" int init(lua_State* L) { using namespace luabind; open(L); module(L) [ def("greet", &greet) ]; return 0; } This compiles to liblbtest.so. However, when I run the commands (as explained in this answer) > lua >

Crash when calling luabind function on object

那年仲夏 提交于 2019-12-11 14:43:17
问题 When I try to run the "Run" function (defined in lua) from C++ (through luabind), I get the following error: Unhandled exception at at 0x767BC41F in Game_Launcher.exe: Microsoft C++ exception: luabind::error at memory location 0x001BF8B8. Using some try/catch trickery I got the slightly less useless messages of: Expression: lua runtime error Expression: Run Lua: local function Run(self) self.ticks = self.ticks + 1 end return { ticks = 0, Run = Run, } C++: void ScriptComponent::Initialize() {

Building Luabind in Windows

﹥>﹥吖頭↗ 提交于 2019-12-11 10:45:37
问题 I'm having problems making Lua & Luabind work under Windows 7 using VS 2010. So far, I've downloaded LuaBinaries from http://luabinaries.sourceforge.net and Luabind from http://www.hci.iastate.edu/~rpavlik/doxygen/luabind/docs.html . I've set up my environment variables BOOST_ROOT and LUA_PATH accordingly in the Command Line as mentioned in Luabind's INSTALL file and I can't get past this error: C:\lua\luabind>bjam stage error: at Jamroot:41 error: *** Unable to determine Lua include

Luabind class deriving problem (memory 'leak')

允我心安 提交于 2019-12-11 04:59:20
问题 Using luabind 0.81 Simple test to illustrate the problem: 1) class 'A' function A:__init() print('A init\n') end function A:__finalize() print('A finalize\n') end do local obj = A() end collectgarbage("collect") Output: A init A finalize 2) class 'A' function A:__init() print('A init\n') end function A:__finalize() print('A finalize\n') end class 'B' (A) function B:__init() A.__init(self) print('B init\n') end function B:__finalize() print('B finalize\n') end do local obj = B() end

What code do I wrap around Lua code in C++?

血红的双手。 提交于 2019-12-11 03:27:08
问题 I finally got LuaBind configured to work with my C++ project. I recently found out that the Tiled map editor has an option to export the files as a .lua, so I wanted to try it out. What code would I wrap around the pasted code below to have it work with my C++ RPG project? return { version = "1.1", luaversion = "5.1", orientation = "orthogonal", width = 24, height = 20, tilewidth = 16, tileheight = 16, properties = {}, tilesets = { { name = "PALLET TOWN", firstgid = 1, tilewidth = 16,

passing a lua table from C++ to .Lua script

橙三吉。 提交于 2019-12-11 01:29:56
问题 I have spent the past 6 hours trying to solve this ! and i coulnt get anywhere :s I want to be able to create a lua table in a c++ file and then pass that to a lua script file, which has the following lua function: function MTable (t) local n=#t for i=1,n do print(t[i]) end end i dynamically created a one dimensional array with two strings: lua_newtable(L); lua_pushstring(L,"10.10.1.1"); lua_pushstring(L,"10.10.1.2"); lua_rawseti(L,-3,2); lua_rawseti(L,-2,1); so now i have the table on top of

LuaBind and package.loadlib

▼魔方 西西 提交于 2019-12-08 04:18:40
问题 I'm trying to go through the tutorial with luabind here, http://www.rasterbar.com/products/luabind/docs.html, however i'm having trouble loading the library. I'm currently using version 5.1 of lua, so I believe I would use package.loadlib instead of loadlib. I made a simple dll which is this: #include <iostream> #include <luabind\luabind.hpp> void greet() { std::cout << "Hello world!\n"; } extern "C" int init(lua_State* L) { luabind::open(L); luabind::module(L) [ luabind::def("greet", &greet)

luabind 0.9.1版本尝试

十年热恋 提交于 2019-12-07 21:09:36
luabind 0.9.1版本尝试 http://www.rasterbar.com/products/luabind 1. 编译luabind 0.9.1 linux版本 编译luabind需要bjam binary。 直接copy boost/1.37.0目录中编译好的bjam binary到~/bin目录,然后在luabin根目录中运行bjam。 编译之前需要设置环境变量BOOST_ROOT=~/mylibs/boost/1.37.0/ 和LUA_PATH=~/mylibs/lua/5.1/ 2. 尝试第一个example,就发现了自己版本的lua5.1 binary不支持loadlib函数 print(loadlib()) 解决办法是在lua src/luaconf.h文件中,将LUA_COMPAT_LOADLIB激活,然后重新编译lua binary 3. 编写C++对LUA的扩展库: 解决2之后,编写如下的C++代码(helloworld.cc) : #include <iostream> #include <luabind/luabind.hpp> void greet() { std::cout << "hello world - my luabind try\n"; } extern "C" int init(lua_State* L) { using