Luarocks / Lua为CJSON窗口找不到安装模块cjson

时间:2018-05-11 00:53:30

标签: module lua cl luarocks

我在这里下载Lua for Windows 5.1.5:

https://github.com/rjpcomputing/luaforwindows/releases

然后我在这里下载了Lua Rocks 2.4.4 win32: https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Windows

现在我的脚本,我需要LUA CJSON模块,但是当我运行脚本

时,我收到此错误
lua: script.lua:6: module 'cjson' not found:
    no field package.preload['cjson']
    no file 'C:\Program Files (x86)\Lua\5.1\lua\cjson.luac'
    no file '.\cjson.lua'
    no file 'C:\Program Files (x86)\Lua\5.1\lua\cjson.lua'
    no file 'C:\Program Files (x86)\Lua\5.1\lua\cjson\init.lua'
    no file 'C:\Program Files (x86)\Lua\5.1\cjson.lua'
    no file 'C:\Program Files (x86)\Lua\5.1\cjson\init.lua'
    no file 'C:\Program Files (x86)\Lua\5.1\lua\cjson.luac'
    no file '.\cjson.dll'
    no file '.\cjson51.dll'
    no file 'C:\Program Files (x86)\Lua\5.1\cjson.dll'
    no file 'C:\Program Files (x86)\Lua\5.1\cjson51.dll'
    no file 'C:\Program Files (x86)\Lua\5.1\clibs\cjson.dll'
    no file 'C:\Program Files (x86)\Lua\5.1\clibs\cjson51.dll'
    no file 'C:\Program Files (x86)\Lua\5.1\loadall.dll'
    no file 'C:\Program Files (x86)\Lua\5.1\clibs\loadall.dll'

所以要安装lua cjson,我去这里:https://www.kyne.com.au/~mark/software/lua-cjson-manual.html

对于2.4,它说我需要运行这个脚本

cd lua-cjson-2.1.0
luarocks make

我打开我的cmd ..输入

cd C:\Users\Admin\Desktop\lua-cjson-2.1.0
luarocks make

我收到此错误:

cl /MD /O2 -c -Folua_cjson.obj -IC:/Program Files (x86)/Lua/5.1/include lua_cjson.c -DDISABLE_INVALID_NUMBERS
'cl' is not recognized as an internal or external command,
operable program or batch file.

Error: Build error: Failed compiling object lua_cjson.obj

任何人都知道如何解决这个问题?一步一步的说明将非常感激。

差不多2个错误 - 未找到模块cjson且cl无法识别命令

1 个答案:

答案 0 :(得分:0)

“ cl.exe”是Microsoft Visual Studio C ++的C ++编译器。您需要安装编译器。如果您没有MS Visual Studio C ++的安装程序,则可以使用MinGW,然后使用选项“ / MW”安装luockcks。