Skip to content

Instantly share code, notes, and snippets.

@yihuang
Created December 29, 2015 03:42
Show Gist options
  • Select an option

  • Save yihuang/cac3e28cbf103c40c151 to your computer and use it in GitHub Desktop.

Select an option

Save yihuang/cac3e28cbf103c40c151 to your computer and use it in GitHub Desktop.
#include "LuaIntf/LuaIntf.h"
extern "C" {
#include "lua.h"
}
using namespace LuaIntf;
void open(lua_State* L) {
LuaBinding(L)
.addConstant("GL_ES_VERSION_2_0", 1)
;
}
int main() {
lua_State* L = luaL_newstate();
open(L);
}
/**
* $ clang++ -std=c++11 test.cpp -llua -g2
* /a.out
* PANIC: unprotected error in call to Lua API (bad argument #-1 (table expected, got nil))
**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment