Lua Learning (1), compiling Lua and helloworld

Source: Internet
Author: User

I studied Python a few days ago and was deeply attracted by her simplicity and efficiency. Today, when I watched cloud wind's "game journey-my programming sentiment", I saw that he highly praised Lua and brought it down for fun at night-BTW, for friends who are interested in game development, we recommend those days of the cloud wind-talking nonsense. Let's get started...

1. Download source code, http://www.lua.org/ftp/lua-5.1.4.tar.gz

2. Compile Lua source code

  • Extract lua-5.1.4.tar.gz to a directory, for example, F:/Program/dev/Lua/lua5_1_4.
  • Open the Command Prompt window of vs2005 (not cmd, because cmd does not contain the compiler and connector path), CD to F:/Program/dev/Lua/lua5_1_4 directory;
  • Run "ETC/luavs. Bat", OK ,example, and several other files such as lua.exew.luac.exe are generated in the srcdirectory;
  • Add the src directory to the system environment variable.

3. helloword

Compile the following code in the editor: Print "Hello World" and save it as the hello. Lua file. Run Lua hello. Lua in the current directory to see the execution result. For more information about how to set up the editor environment, see Lua Learning (2) manually configure Lua development tools. 4. if you use luac for compilation, such as luac-O hello.exe hello. lua, you can see the generated hello.exefile. If hello.exe is executed, "s32evnt1. DLL start setting failed for the virtual device driver that can be installed by dll "error;

C:/program files/Symantec/s32evnt1. dll not found, solution is from http://www.dll-files.com/dllindex/s32evnt1.zip? Download the 0vgmvccddp file and copy it to the corresponding path. Other solutions ref references ". In the third part, we can use the luacommand to successfully execute the command, because lua.exe is a Lua interpreter. In addition, we can also use other host languages to call Lua code (such as C/C ++). Backdoor learning will be provided. You are welcome to reprint it. Please indicate that it is from hi, coder

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.