lua-users home
lua-l archive

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


Hi! I'm Judith!
I encounter a problem while OC calls lua file by C- API,
call_a.lua  call_b.lua are in the same director,
oc pcall call_a.lua
call_a.lua require("call_b")
but oc always reports error as follow:

/Users/judith/Library/Developer/Xcode/DerivedData/CallLuaTest-axkrsjebjsgswnfllylhmergmvmv/Build/Products/Debug/CallLuaTest.app/Contents/MacOS/CallLuaTest PANIC: unprotected error in call to Lua API (cannot run the lua file: [string "package.path = package.path ..";../Resources/..."]:2: module 'call_b' not found:

no field package.preload['call_b']

no file '/usr/local/share/lua/5.3/call_b.lua'

no file '/usr/local/share/lua/5.3/call_b/init.lua'

no file '/usr/local/lib/lua/5.3/call_b.lua'

no file '/usr/local/lib/lua/5.3/call_b/init.lua'

no file './call_b.lua'

no file './call_b/init.lua'

no file '../Resources/call_b.lua'

no file '/usr/local/lib/lua/5.3/call_b.so'

no file '/usr/local/lib/lua/5.3/loadall.so'

no file './call_b.so')

there is no problem in C project which be built by Xcode with the two lua files
I have been struggling with this problem for two days.
I would be appreciate it if there is a solution.

Thanks!