Basic learning of lua (1): Use Visual Studio to compile lua and luac
0. Background
This blog is lua
the first blog for basic learning. It mainly introduces the use Visual Studio
of lua5.0
pair compilation, with the purpose of obtaining lua.exe
and luac.exe
files.
The relevant versions of the software used are:
Visual Studio
: 2022
lua
:5.0
1. Download lua source code
lua
Official download address of source code: https://www.lua.org/ftp/
2. Create a new Visual Studio project
- Create empty project
- The project name is set to
LuaTest
3. Import source files
4. Compile lua.exe
4.1 Import files
- Create new filter
The filter item structure is as follows:
- Import files
4.2 Compilation
- Compile directly
- Prompt that some files were not found
4. Add ../include;../src
5.
6.
7. Regenerate
4.3 Testing
5. Compile luac.exe
5.1 Import files
-
Create new filter
-
Add existing item
5.2 Compilation
-
Add additional directories
-
Add command line
-
compile
5.3 Testing
- Create new
test.lua
file
print("hello luac")
x. Summary
This blog records the process of using Visual Studio
compilation lua
as a staged footprint.