Mini Lua-Adapter
Use this minimal wrapper- / adapter-class as an interface between Lua 5.3+ and C++:
MiniLua lua{"test.lua"};
int width {0};
lua.Get("width", width);
std::string title{"empty"};
if(lua.Get("title", title))
std::cout << title;Compile and test
Linux or Unix:
$ g++ MiniLua.cpp test.cpp -llua -ldlBuild Lua 5.4 and test MiniLua using CMake
The CMakeLists.txt in this directory downloads Lua and tries to build it. It compiles a short test-program, too.
$ cmake ./
$ make