title: Lua - initializing
body: <p>I can't init lua correctly under Arch Linux. Lua - latest version. Here is my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  extern "C"
  {
      #include &lt;lua.h&gt;
      #include &lt;lauxlib.h&gt;
      #include &lt;lualib.h&gt;
  }
  
  int main()
  {
      lua_State *luaVM = luaL_newstate();
      if (luaVM == NULL)
      {
          printf("Error initializing lua!\n");
          return -1;
      }
  
      luaL_openlibs(luaVM);
      lua_close(luaVM);
  
      return 0;
  }
  </code></pre>
  
  <blockquote>
    <p>/tmp/cc0iJ6lW.o: In function <code>main':
    test_lua.cpp:(.text+0xa): undefined reference to</code>luaL_newstate'</p>
    
    <p>test_lua.cpp:(.text+0x34): undefined reference to `luaL_openlibs'</p>
    
    <p>test_lua.cpp:(.text+0x40): undefined reference to `lua_close' collect2: ld</p>
    
    <p>returned 1 exit status</p>
  </blockquote>
  
  <p>What's wrong?</p>