brunph / Lua-Adapter

lightweight header-only Lua - C++ adapter / binding

Repository from Github https://github.combrunph/Lua-AdapterRepository from Github https://github.combrunph/Lua-Adapter

Lua-Adapter

Use this C++-class to bind Lua or even MoonScript to C++.

Usage

#include "LuaAdapter.hpp"

int main(){
  LuaAdapter lua{"test.lua"};

  int width {0};
  lua.Get("width", width);  // width=600

  return 0;
}
$ g++-8 the_program_above.cpp -std=c++17 -llua -ldl

Please see more examples.

Support for older g++-versions

If the latest g++ features are not available on your system (for example on Windows), then try Lua-Adapter/MiniLua. This is a somewhat minimal and simple version of Lua-Adapter which doesn't make use of these new features (like if constexpr ..)

Lua without Lua

Run Lua-code (embedded in your C++-code) on machines where Lua is not installed.

examples/static.cpp shows you how to compile any Lua-code into your C++-application together with the Lua-interpreter.

About

lightweight header-only Lua - C++ adapter / binding

License:MIT License


Languages

Language:C++ 98.9%Language:Lua 0.9%Language:Makefile 0.2%