title: C++ Unresolved External Symbols Embedded Lua
body: <p>I am trying to make a game with Visual C++ 2010 with an embedded Lua engine, but I keep running into persistent unresolved external symbol errors. I put copies of all the files in the 'include' folder in the project headers folder, and I tried setting the linker library path to the Lua lib folder, as well as setting the include path to the Lua include folder, but I still am getting errors stating that the usage of a couple of Lua core functions are unresolved. I already tried quite a few solutions posted around the internet and each of which resulted in the same errors.</p>
  
  <p>Output:</p>
  
  <pre><code>1&gt;Main.obj : error LNK2019: unresolved external symbol _lua_pcall referenced in function _main
  1&gt;Main.obj : error LNK2019: unresolved external symbol _luaL_loadfile referenced in function _main
  1&gt;Main.obj : error LNK2019: unresolved external symbol _luaL_newstate referenced in function _main
  </code></pre>
  
  <p>Main.cpp:</p>
  
  <pre><code>#include "stdafx.h"
  #include "Bubble Wars.h"
  
  extern "C" {
  #include "lua.h"
  #include "lualib.h"
  #include "lauxlib.h"
  #include "luaconf.h"
  #include "lua.hpp"
  }
  
  int main()
  {
      lua_State * L = lua_open();
      luaL_dofile(L,"C:/Users/Trevor/Documents/Visual Studio 2010/Projects/Bubble Wars/Bubble Wars/Main.lua");
      return 0;
  }
  </code></pre>
  
  <p>Main.cpp is the only source file that contains any Lua references. Any reasons for the function references to be unresolved?</p>