Re: Sharing a lua_State across DLL boundary
Jason McKesson <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
On Apr 26, 2011 9:57 PM, Julien Lebot wrote: > Hi all, > > I have a DLL which opens a lua_State and calls luabind::open on it. I > then expose a few classes to it, and all is > working well. > Now I have a client executable that links with this DLL and where I'd > like to expose some more classes, so I obtain the lua_State created in > this DLL, bind a few more classes to it. > The problem is when I try to call functions from Lua on those classes > lua/luabind crashes, either with "lua runtime error" if I did > luabind::call_function and the lua function calls my new C++ classes' > functions or something like "No matching overload found, candidates: > void loadResource(ResourceManager&, std::string const&)" if I use > lua_dofile and the file calls my new C++ classes' functions. > > Any idea ? > > Regards, > Julien Lebot In order to do what you're suggesting, both Lua and Luabind must be built as DLL's themselves, and all of the DLL's using them must be linked against those DLL's. ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd