![]() ![]() # To install make and cc (an alias for gcc) on Ubuntu: Here are shell commands to achieve this on Ubuntu, which happens to be the Linux distribution I’ve used the most: ![]() If you’re working on Linux, you’ll need to ensure that you have a C compiler as well as some flavor of make. If running gcc doesn’t open a dialog box but rather causes gcc to print a complaint about a lack of input files, these tools are already installed. Click the Install button in that dialog box and follow through with the installation. If you don’t have the developer tools installed, you’ll be prompted with a dialog box explaining that you need to install them. The easy way to install these is to open a terminal (such as the built-in Terminal app) and attempt to run a developer command such as gcc. To build Lua’s source on macOS, you’ll need to have command-line developer tools like make installed. We’ll dive into all the relevant details of this stack and the interlanguage interface within the first three chapters of this book. You can think of the Lua stack as a window into the set of Lua values currently relevant to your C code. To this end, every Lua state has a Lua stack, which is a container for Lua values such as Lua strings or tables. Virtually every function in Lua’s C API accepts a Lua state as its first parameter.īecause Lua states are opaque structures, we need to use API functions to access the Lua values stored within a state. This structure knows everything about a running Lua environment, including all global values, closures, coroutines, and loaded modules. A Lua state is a C pointer to an opaque data structure. Lua’s C API can create or destroy entire runtime environments, which are referred to as Lua states. In other words, Lua is not only written in C it is also written to be used from C. Many users interact with Lua by using the official interpreter, but even this interpreter is built on top of the C API, without any special access to the language’s implementation. Lua, on the other hand, is essentially distributed as a C API. Many programming languages are distributed in the form of a language-specific compiler or interpreter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |