Setting the global LUA_PATH variable from C++/C?
问题 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 iPhone app has a separate folder in the device ). I know I could set the LUA_PATH by recompiling lua with a "fixed" path, but that's quite far from ideal. ( I'm trying to do this in order to be able to use require , from my .lua scripts. Could anyone help me out here ? 回答1: In C++: int setLuaPath( lua_State* L, const char* path