How to compile Lua 5.4.0 for Windows

Thursday, May 21st, 2020 | Dennis D. Spreen | Lua

This is a tutorial on how to compile Lua 5.4.0 for Windows (32-bit and 64-bit executable and DLL) with the Microsoft Visual Studio Community Edition.

This tutorial on how to build Lua for Windows is based on the great video How to Manually Install Lua 5.2 on Windows – thank you!

You may download the latest pre-compiled Lua libraries and executables at http://luabinaries.sourceforge.net

1. Download and install Visual Studio Community Edition 2019 – do not use any older/newer version (tested with 16.6.0 only)

2. Download and extract the Lua 5.4.0 source code

3. Open a x86 Native Tools Command Prompt for VS 2019 to compile for 32-bit or open a x64 Native Tools Command Prompt for VS 2019 for 64-bit, then navigate to the extracted Lua src/ folder and run inside this folder the following commands

You’re done! You should now have a lua.exe interpreter, a luac.exe compiler and a lua5.4.0.dll. You may use the %VSCMD_ARG_TGT_ARCH% environment variable to distinguish between 32- and 64-bit.

Tags: , , , ,

1 Comment to How to compile Lua 5.4.0 for Windows

[…] posts How to compile Lua 5.4.0 for Windows How to compile Lua 5.3.0 for Android as a dynamic […]

Leave a comment

About Dennis D. Spreen

I'm an avid programmer working on a variety of platforms in a variety of languages with a wide technical interest.

Search

QR Code

Categories