lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm integrating toLua++ into our project and I have this question:

Looking at all of the toLua++ examples provided in the \src\test directory, I see that all the test-projects are constructed in the same way:

there is a .c or .cpp file with a main().  Inside the main, the following is done:

int main ()
	int  tolua_tclass_open (lua_State*);

	lua_State* L = lua_open();
	tolua_tclass_open(L);  // initialize the C ==> Lua binding

	lua_dofile(L,"TEST.lua");  // Line in question

	return 0;


i.e., the lua file is executed from within the running C or C++ program.

It would be nice to be able to run the Lua scripts from within the LuaIde debugger.  That means that I would comment out the above "Line in question", still set up the environment (i.e. start the C program which initializes the binding), but, run the test-script from within the IDE and not from within the main().

When I do this, I immediately get errors because the Lua environment in the IDE isn't initialized with the binding, and therefore the variables are not bound to the IDE's Lua environment.

How could I accomplish this?  I.e. run my Lua scripts inside the IDE debugger and still have the Lua ==> C binding?