Lua基本环境搭建

1.基本环境搭建

我的本机环境是:win7专业版,64位

Lua的下载地址是:http://files.luaforge.net/releases/luaforwindows/luaforwindows   下载最新版本,我下的是: 5.1.4-35

安装中报错,缺少运行库:(Please wait while setup is downloading the Microsoft Visual C++ 2005 SP1 Redistributable to your computer.)

他自己的下载一直失败,报timeout,我们可以自己到windows的官网下载,地址为:

https://download.microsoft.com/download/e/1/c/e1c773de-73ba-494a-a5ba-f24906ecf088/vcredist_x86.exe

下载安装完毕之后,再安装Lua可以安装成功。

打开自己的cmd命令行,输入Lua,可以看到进入脚本的命令行

安装成功。

2.命令行

usage: lua.lua [options] [script [args]].
Available options are:
  -e stat  execute string 'stat'
  -l name  require library 'name'
  -i       enter interactive mode after executing 'script'
  -v       show version information
  --       stop handling options
  -        execute stdin and stop handling options

  -e 执行一段lua代码

  -l 加载一个lua库,比如自定义的lua函数

  -i 打开交互模式,试了下,和直接运行lua,不加任何参数的效果是一致的

  -v 输入下lua版本号,这个常见

  -- 和 -暂时没有发现咋用,用lua源码来看也没有特殊的含义,找到了再更新

原文地址:https://www.cnblogs.com/chenjie0949/p/7305985.html