I\'m trying to set my global LUA_PATH variable directly from C/C++, I\'m using Lua from my iPhone applications, so my path tends does change between applications ( each iPho
You can set the LUA_PATH and LUA_CPATH within c++ very easily by executing a couple lual_dostring functions.
luaL_dostring(L, "package.path = package.path .. ';?.lua'");
luaL_dostring(L, "package.cpath = package.cpath .. ';?.dll'");
These two line called after you have your lua_State (L here) and before your lual_loadfile() and lau_pcall() function calls will add to the currently set path and cpath. In this case I add to both an instruction to look local to the execution.
It took me hours to find this solution.. I hope it helps.