sol2/examples/source/tutorials/open_multiple_libraries.cpp

17 lines
339 B
C++
Raw Normal View History

2019-07-04 23:16:03 +08:00
#define SOL_ALL_SAFETIES_ON 1
#include <sol/sol.hpp>
int main(int argc, char* argv[]) {
2020-10-04 05:34:34 +08:00
// silence unused warnings
(void)argc;
(void)argv;
2019-07-04 23:16:03 +08:00
sol::state lua;
lua.open_libraries(sol::lib::base,
sol::lib::coroutine,
sol::lib::string,
sol::lib::io);
2019-07-04 23:16:03 +08:00
lua.script("print('bark bark bark!')");
return 0;
}