1 require("lala");
1 1>F:\Git\luatest\metaTest.lua:(56): module 'lala' not found: 2 no field package.preload['lala'] 3 no file '.\lala.lua' 4 no file 'D:\Program Files (x86)\LuaStudio\lua\lala.lua' 5 no file 'D:\Program Files (x86)\LuaStudio\lua\lala\init.lua' 6 no file 'D:\Program Files (x86)\LuaStudio\lala.lua' 7 no file 'D:\Program Files (x86)\LuaStudio\lala\init.lua' 8 no file 'C:\Program Files\Lua\5.1\lua\lala.luac' 9 no file 'F:\Git\luatest\lala.lua' 10 no file '.\lala.dll' 11 no file 'D:\Program Files (x86)\LuaStudio\lala.dll' 12 no file 'D:\Program Files (x86)\LuaStudio\loadall.dll' 13 Stack Traceback: 14 [C]: in function 'require' 15 F:\Git\luatest\metaTest.lua:56: in main chunk
1 print(package.path);
1 ;.\?.lua; 2 D:\Program Files (x86)\LuaStudio\lua\?.lua; 3 D:\Program Files (x86)\LuaStudio\lua\?\init.lua 4 ;D:\Program Files (x86)\LuaStudio\?.lua; 5 D:\Program Files (x86)\LuaStudio\?\init.lua; 6 C:\Program Files\Lua\5.1\lua\?.luac; 7 F:\Git\luatest\?.lua
1 print(package.cpath);
.\?.dll; D:\Program Files (x86)\LuaStudio\?.dll; D:\Program Files (x86)\LuaStudio\loadall.dll
1 package.path = package.path ..';..\\?.lua';
1 require("requiretest2.loader2");
1 print("requiretest2.loader2");
1 requiretest2.loader2
在項目實際運用時能夠根據需求加入相對目錄。post
些許淺薄認識 若有不妥之處望請斧正!!!!!測試