Install LuaRocks with Lua 5.2 on Windows 7
Below are steps to install LuaRocks 2.1.0 with Lua 5.2 on Windows, using Visual Studio(Express):
Download Lua 5.2 source code
Build lua52.dll, and lua5.2.exe. Note:
Add
LUA_COMPAT_ALL
to C/C++ Preprocessor Definitionlua5.2.exe has to depends on lua52.dll, otherwise you will see errors like "multiple VMs" when using a C module
Copy executable files, libraries, and source code to a folder. The folder structure looks like:
LuaFolder/ |-bin/ | |-lua5.2.exe | |-lua52.dll | |-luac5.2.exe(Optional?) | |-lib/ | |-lua52.lib | |-include/ |-Header files from Lua source code
Download and unpack LuaRocks. I am using version 2.1.0.
Install:
install.bat /P InstallDir /LV 5.2 /LUA LuaFolder
Goto install dir, and edit config.lua. Change value of
variables.LUALIB
fromlua52.dll
tolua52.lib
.Add PATH, LUA_PATH and LUA_CPATH to system env, according to the output of install.bat
Additional paths:
PATH : %LuaRocksDir%/bin LUA_CPATH : %LuaRocksDir%/lib\lua\5.2
Done!
To install a Lua module using LuaRocks, you have to open a command line window with Visual Studio environment, then enjoy luarocks install xxx
!
blog comments powered by Disqus