zoukankan      html  css  js  c++  java
  • MAC 上搭建lua环境

    一、下载并安装

    (1)最新release版下载地址

    http://www.lua.org/ftp/lua-5.3.1.tar.gz

    (2)编译

    Building

    Lua is implemented in pure ANSI C and compiles unmodified in all platforms that have an ANSI C compiler. Lua also compiles cleanly as C++.

    Lua is very easy to build and install. There are detailed instructions in the package but here is a simple terminal session that downloads the current release of Lua and builds it in Linux:

    curl -R -O http://www.lua.org/ftp/lua-5.3.1.tar.gz
    tar zxf lua-5.3.1.tar.gz
    cd lua-5.3.1
    make linux test

    For Mac OS X, use make macosx test.

    正常情况下会出现: src/lua -v

    (3)安装

    然后再输入“sudo make install”命令,会要求输入Password:     输入相应密码(你的密码),然后回车就自动安装了
    待安装完成后可输入 lua -v,回车就会看到 :
    Lua 5.3.1  Copyright (C) 1994-2015 Lua.org, PUC-Rio
    OK ,已经安装成功!

     

    二、使用IDE

    1. 安装Sublime

    2. 安装Lua编译器

    Tools->Build System->New Build System

    输入:

    {  
     "cmd": ["/usr/local/bin/lua", "$file"],  
     "file_regex": "^(...*?):([0-9]*):?([0-9]*)",  
     "selector": "source.lua"  
    }  

    保存为Lua.sublime-build,然后Tools-Build System上就能选择lua来编译脚本了。

    3. 使用Sublime编写Lua代码

    lua的编辑和运行环境已经搭建好了
    新建一个hello.lua文件,随便写个语句,选择lua为build system,按一下Command+B,就能跑出来了。
    MAC 上搭建lua - Sylar_Lin - 低调做人高调做事
     
  • 相关阅读:
    品鉴-宋词
    【转载】全球水质最棒的十大景点
    Python文档管理与格式化工具
    Python音频处理
    Python剪切板提取、截图、图片粘贴,操作汇总
    Python多进程
    Wifi配置
    条码生成与解析
    谎言: “太空能看到的惟一的人工痕迹,长城!”
    VNC-Server安装配置详解
  • 原文地址:https://www.cnblogs.com/yeahwell/p/4775018.html
Copyright © 2011-2022 走看看