6

How to Call C++ from Lua

In the previous three chapters, we focused on learning how to call Lua from C++. In this chapter, we will start to learn how to call C++ from Lua. This is important for your applications because although Lua scripts can extend your C++ applications, they can also benefit from the functions provided by your native C++ code.

This also means we will learn more concepts and piece different things together to make it work. Although the chapters are laid out in a way that they extend the previous chapter in a seamless flow, you may need a different pace to absorb the new concepts. Do read the sections more times if you need practice with coding.

We will cover the following topics:

  • How to register C++ functions
  • How to override ...

Get Integrate Lua with C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.