• 在Windows环境下构建Lua 入门


    在Windows环境下构建Lua

    一:准备软件

             1.C-compiler(TDM GCC)  http://tdm-gcc.tdragon.net/download

             2.Lua源代码  http://www.lua.org/download.html

             3.用2345好解软件更方便。解压软件7-zip,这里不使用官方版本

       http://portableapps.com/apps/utilities/7-zip_portable

            

    二:安装软件

    1. gcc

     

     

     

     

    安装完成gcc后的目录结构如下

     

    2.安装解压软件 7-Zip (用好压吧,反正这一步就是把lua的目录解压出来)

    3.创建一个cmd文件,如build.cmd,并将以下文本拷贝进去

    @echo off

            :: ========================

            :: file build.cmd

            :: ========================

            setlocal

            :: you may change the following variable's value

            :: to suit the downloaded version

            set lua_version=5.2.2

            set work_dir=%~dp0

            :: Removes trailing backslash

            :: to enhance readability in the following steps

            set work_dir=%work_dir:~0,-1%

            set lua_install_dir=%work_dir%lua

            set compiler_bin_dir=%work_dir% dm-gccin

            set lua_build_dir=%work_dir%lua-%lua_version%

            set path=%compiler_bin_dir%;%path%

            cd /D %lua_build_dir%

            mingw32-make PLAT=mingw

            echo.

            echo **** COMPILATION TERMINATED ****

            echo.

            echo **** BUILDING BINARY DISTRIBUTION ****

            echo.

            :: create a clean "binary" installation

            mkdir %lua_install_dir%

            mkdir %lua_install_dir%doc

            mkdir %lua_install_dir%in

            mkdir %lua_install_dir%include

            copy %lua_build_dir%doc*.* %lua_install_dir%doc*.*

            copy %lua_build_dir%src*.exe %lua_install_dir%in*.*

            copy %lua_build_dir%src*.dll %lua_install_dir%in*.*

            copy %lua_build_dir%srcluaconf.h %lua_install_dir%include*.*

            copy %lua_build_dir%srclua.h %lua_install_dir%include*.*

            copy %lua_build_dir%srclualib.h %lua_install_dir%include*.*

            copy %lua_build_dir%srclauxlib.h %lua_install_dir%include*.*

            copy %lua_build_dir%srclua.hpp %lua_install_dir%include*.*

            echo.

            echo **** BINARY DISTRIBUTION BUILT ****

            echo.

            %lua_install_dir%inlua.exe -e"print [[Hello!]];print[[Simple Lua test successful!!!]]"

            echo.

            pause

     4.双击运行build.cmd,等待完成

    此时安装目录下的文件结构:

     

  • 相关阅读:
    vs.net 2005, 没有找到MSVCR80D.dll的完美解决方案
    C++内存布局从一个修改私有变量的问题想到的
    堆栈详解
    加载.x文件
    深入分析规则引擎
    高级着色语言HLSL入门(5)
    字符数组,字符指针,Sizeof总结
    C++ 隐式和显式 初始化,类型转换
    fread()和fwrite()函数分析
    结构体 对齐的问题
  • 原文地址:https://www.cnblogs.com/imzhstar/p/3608050.html
Copyright © 2020-2023  润新知