All pastes #901493 Raw Edit

Lua C-API problem

public c v1 · immutable
·published 2008-02-12 18:30 UTC
rendered paste body
#include <stdio.h>#include <iostream>#include <string.h>extern "C" {#include "lua.h"#include "lauxlib.h"#include "lualib.h"}using namespace std;static void ct(lua_State *L){	cout << "Hello World!" << endl;}int main(int argc, char* argv[]){	lua_State *L = luaL_newstate();	L = lua_open();	luaL_openlibs(L);	lua_register(L, "ct", ct);	luaL_dofile(L, "test.lua");	lua_close(L);	return 0;}