2014-01-19 11:59:59 +08:00
|
|
|
#include <sol.hpp>
|
|
|
|
|
2016-08-11 08:39:30 +08:00
|
|
|
#include <iostream>
|
|
|
|
|
2014-01-19 11:59:59 +08:00
|
|
|
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
|
2016-08-11 08:39:30 +08:00
|
|
|
std::cout << "=== basic example ===" << std::endl;
|
|
|
|
lua.script("print('hello world')");
|
|
|
|
|
|
|
|
std::cout << std::endl;
|
2014-01-19 11:59:59 +08:00
|
|
|
}
|