我在 C++ 应用程序中称为 lua。我有几个 lua 文件要调用,比如RunAPI_1208.lua
,JSON.lua
等。所有的 lua 文件都由 main.lua 调用。在 C++ 中,我运行所有文件,最后运行main.lua
. 我遇到了这个问题。我正在使用 Cocos2d-x 2.2.6。我该如何解决?
[string "Main.lua"]:9: module 'RunAPI_1208' not found:
no field package.preload['RunAPI_1208']
no file './RunAPI_1208.lua'
no file '/usr/local/share/lua/5.1/RunAPI_1208.lua'
no file '/usr/local/share/lua/5.1/RunAPI_1208/init.lua'
no file '/usr/local/lib/lua/5.1/RunAPI_1208.lua'
no file '/usr/local/lib/lua/5.1/RunAPI_1208/init.lua'
no file './RunAPI_1208.so'
no file '/usr/local/lib/lua/5.1/RunAPI_1208.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
Cocos2d: [string "Main.lua"]:9: module 'RunAPI_1208' not found:
no field package.preload['RunAPI_1208']
no file './RunAPI_1208.lua'
no file '/usr/local/share/lua/5.1/RunAPI_1208.lua'
no file '/usr/local/share/lua/5.1/RunAPI_1208/init.lua'
no file '/usr/local/lib/lua/5.1/RunAPI_1208.lua'
no file '/usr/local/lib/lua/5.1/RunAPI_1208/init.lua'
no file './RunAPI_1208.so'
no file '/usr/local/lib/lua/5.1/RunAPI_1208.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
这是我的 main.lua:
local run = require("RunAPI_1208")