[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua-Noob question on using Lua from C++
- From: "RJP Computing" <rjpcomputing@...>
- Date: Wed, 17 Dec 2008 13:18:39 -0500
On Wed, Dec 17, 2008 at 9:15 AM, Michael Mzik <M.Mzik@cs-group.de> wrote:
Hi there !
I am rather new to Lua and currently trying to
integrate Lua into our C++ applications.
Although there are good documentation resources
around, I would like to ask two beginner-questions:
what is the best way to use Lua from
C++ (Wrappers, exception-handling, etc)?
I would recommend Luaxx header only C++ wrapper around the Lua C API, if you are writing them yourself. This will allow you to use try/catch around your code to catch the 'exit()' function for you. Also as a tip you should not throw from you modules. It just doesn't work well and makes it very hard to code right.'
Here is a copy that I updated from the original creator of Luaxx that has much more bound and covers many of the standard containers (e.g. vector, map, pair). 
Now if you want a decent binding library I suggest toLua++ I have had good success using it.
and how may I intercept "exit"-statements
in Lua-Script in C++ to prevent my whole application from closing?
Hope this helps. If you use svn the latest source of Lua and Luaxx can be found at the GoogleCode project called luasvnrepo.