Skip to content
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Lua-Adapter/MiniLua/
Lua-Adapter/MiniLua/

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

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 -ldl

Build 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