AboutUbuntu LUA InstallationEnvironment is the content to be introduced in this article, mainly to understandLuaInUbuntuUnderInstallEnvironment. For more information, see this article.LuaIt is an extended programming language designed to support generic procedural programming and provide relevant data descriptions.
LuaIt can also provide good support for Object-Oriented Programming, functional programming, and data-driven programming. It can be used as a powerful and lightweight scripting language for any program.LuaProvided in the form of a library written in clean C. The so-called Clean C Refers to a subset of ansi c and C ++)
As an extended language,LuaThere is no concept of "main" program: it can only work in one host program, which is called embedding program or host for short. The host program can execute a small segment by calling the function.LuaCode. You can read and write Lua variables and inject the C function to call Lua code.
These extended C functions can greatly expand the field in which Lua can process transactions, so that various languages can be customized, and they share a unified syntax format framework. The official Lua release containsLuaIt uses the Lua library to provide a unique Lua interpreter.
Lua is a free software. Its license determines that its use process is generally not guaranteed.
Lua installation (in linux:
Method 1)
My operating system is:
- Linux oracle-desktop 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux
Run the sudo apt-get install lua5.1 commandInstallUpperLuaBut embedded in CLuaWe will say we cannot find lua. h and other files. Therefore, if you simply run the lua command to execute some lua statements, this is enough, but if you embed it in the C language, you must use method 2.
Method 2)
My operating system is:
- Linux oracle-desktop 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux
1) go firstLuaDownload the latest release package, I chose http://www.lua.org/ftp/
2) run the tar-xzvf command.Lua-5.1.4.tar.gz
3) cd lua-5.1.4, and then execute make, will prompt you enter make system, because my system is linux, So I enter make linux
However, error: readline/readline. h: no such file or directory is reported during the running process.InstallReadline-6.1.tar.gz, so I go to wget
- Http://www.sfr-fresh.com/unix/misc/readline-6.1.tar.gz,
- Tar-zxvf readline-6.1.tar.gz, cd ~~ ./Configure & make install,
- Sudo ldconfig,
- Run make linux again. The readline error is not reported, but the error/usr/bin/ld: cannot find-lncurses is prompted. After searching for it online, you have to download the ncurses installation, wget
- Http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.7.tar.gz,
- Tar-xvf ncurses-5.7.tar.gz,
- Then cd ncurses-5.7 ,.
- /Configure, make, make install,
- Run make linux again and everything will be OK.
4) sudo make install
Summary: AboutUbuntu LUA InstallationThe detailed environment description is complete. I hope that learning through this article will help you!