在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
2021年8月18日11:22:26
官网 http://luabinaries.sourceforge.net/ https://github.com/rjpcomputing/luaforwindows https://github.com/rjpcomputing/luaforwindows/releases 下载最新的, 我这边看到最新的是 Lua for Windows v5.1.5-52 Released
lua的包管理是 luadist 这个windows使用 luarocks linux使用 这里有个尴尬的问题就是windows的lua最新的只有5.1.5,最新版的到5.4.3 luadist官网 http://luadist.org/ 上还显示现在不在维护建议luarocks,luarocks在windows上支持还不好
windows下自己编译,下载 @echo off setlocal :: Lua安装绝对路径 set lua_install_dir=C:\lua\lua :: Lua源码绝对路径 set lua_build_dir=C:\lua\lua-5.3.6 :: 进入Lua源码路径并使用mingw中的gcc编译器进行编译Lua cd /D %lua_build_dir% mingw32-make PLAT=mingw echo **** BUILD LUA FINISH **** :: 创建Lua安装目录以及该目录下的doc,bin,include和lib目录 mkdir %lua_install_dir% mkdir %lua_install_dir%\doc mkdir %lua_install_dir%\bin mkdir %lua_install_dir%\include mkdir %lua_install_dir%\lib ::拷贝编译后的文件到doc,bin,include和lib目录中 copy %lua_build_dir%\doc\*.* %lua_install_dir%\doc\*.* copy %lua_build_dir%\src\*.exe %lua_install_dir%\bin\*.* copy %lua_build_dir%\src\*.dll %lua_install_dir%\bin\*.* copy %lua_build_dir%\src\luaconf.h %lua_install_dir%\include\*.* copy %lua_build_dir%\src\lua.h %lua_install_dir%\include\*.* copy %lua_build_dir%\src\lualib.h %lua_install_dir%\include\*.* copy %lua_build_dir%\src\lauxlib.h %lua_install_dir%\include\*.* copy %lua_build_dir%\src\lua.hpp %lua_install_dir%\include\*.* copy %lua_build_dir%\src\liblua.a %lua_install_dir%\lib\liblua.a echo **** COPY LUA FINISH **** :: 使用Lua安装目录下的bin目录中的lua.exe来验证是否编译Lua成功 %lua_install_dir%\bin\lua.exe -e "print [[Hello!]];print[[Simple Lua test successful!!!]]" :: Lua编译成功后设置Lua的环境变量来安装Lua setx Path "%lua_install_dir%\bin;%Path%" /m :: Lua编译成功后,luarocks的运行 LUA_INCDIR C:\lua\lua\include setx LUA_INCDIR "%lua_install_dir%\include; /m echo **** SET LUA ENV VAR FINISH **** pause 注意事项: C:\Users\pc>where gcc mingw32-make PLAT=mingw mingw下载地址 https://www.mingw-w64.org/doku.php/download luarocks的运行 LUA_INCDIR C:\lua\lua\include
setx LUA_INCDIR "%lua_install_dir%\include; /m
luarocks历史版本
luarocks 国内镜像地址 https://luarocks.cn/ 使用参考 https://segmentfault.com/a/1190000003920034 官方文档 https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Windows
还有一个方法是 https://luarocks.github.io/luarocks/releases/ 下载 luarocks-3.7.0-win32.zip (legacy Windows package, includes Lua 5.1) 这种自带lua的包 参考 https://www.cnblogs.com/xulang/p/12535667.html 自己编译一下,比我之前方法简单一些,但是也会遇到上面的 问题 最后还是包无法在windows下使用的问题,早换linux开发早好
参考: https://blog.csdn.net/techfield/article/details/82883299 https://www.freesion.com/article/40321374871/
|
请发表评论