title: Embedding Lua in C++
body: <p>I've been trying to embed lua in a c++ application but to no avail since the compiler complains about "lua_open".I'm using Lua 5.2.</p>
  
  <p>I found alot of articles claiming that lua_open() was replaced in the fifth version but none of them mentioned with what.</p>
  
  <p>Here's the code I am trying to compile</p>
  
  <pre><code>extern "C" {
  #include "../lua/lua.h"
  #include "../lua/lualib.h"
  #include "../lua/lauxlib.h"
  }
  
  int main()
  {
      int s=0;
  
      lua_State *L = lua_open();
      // load the libs
      luaL_openlibs(L);
      luaL_dofile(L,"example.lua");
      printf("\nDone!\n");
      lua_close(L);
  
      return 0;
  }
  </code></pre>