blob: cf00ee70ab290bbc98f712575ca18c98ecda3391 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include <sol.hpp>
#include <iostream>
int main() {
// create an empty lua state
sol::state lua;
// by default, libraries are not opened
// you can open libraries by using open_libraries
// the libraries reside in the sol::lib enum class
lua.open_libraries(sol::lib::base);
// call lua code directly
std::cout << "=== basic example ===" << std::endl;
lua.script("print('hello world')");
std::cout << std::endl;
}
|