mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
14 lines
365 B
C++
14 lines
365 B
C++
#include <sol.hpp>
|
|
|
|
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
|
|
lua.script("print('hello world')");
|
|
} |