Lua03——Development environment setup

1 Install development plug-in

image.png

Install Lua's development plug-in EmmyLua in idea or vscode

image.png

2 Create project

Create a new project in idea

image.png

Select Lua as the type of project

image.png

Enter the project name and target directory

image.png

Set the local installation directory of Lua in the SDK of the project structure

image.png

Select lua in the modules of the project structure

image.png

3 Write the first lua program

Add the program package under the project and create the Lua program file. It should be noted that New Lua File should be selected here.

image.png

Enter the following code in the file

print("你好, Lua!")

image.png

4 Execute program

Right click on the above program and execute

image.png

If the above error occurs, it means that the executable file of Lua is different from the default lua.exe in idea, and the execution parameters need to be modified.

Click Configuration Edit in the upper right corner

image.png

Modify the program content to have the same name as the actual executable file, here it is lua53.exe

image.png

After modification, save and re-execute, you can see the following output

lua53.exe com/study/lua/HelloLua.lua

Hello, Lua!

At this point, the Lua program development environment is set up!

Guess you like

Origin blog.csdn.net/QQ156881887/article/details/132723472