You need to write a tool in Lua, C + + calls Lua, and this LUA will require other LUA scripts, set Package.path in the main LUA, but fail all the time, even if Lua doesn't compile.
Project_path == Project_path. " /?. LUA; " = Package.path. " ; ".. Path
Require "test"
Online Search A lot also did not find, accidentally thought is because there is no open corresponding Lua library so the LUA call is unsuccessful (novice one)?
And then add in C + +
lua_pushcfunction (L, luaopen_package); Lua_pushstring (L, lua_iolibname); 1 0 ); -1);
And then run it again, done!.
In fact, the above one open the corresponding library is not very flexible, it is best to load all the library at once, so as to avoid encountering such problems still have to check whether C part forgot to load LUA library,
// Open All Libraries at once Lual_openlibs (L);
Use of Lua Package.path