title: Unresolved external symbols with Boost
body: <p>I am trying to compile the Boost.Regex program from the <a href="http://www.boost.org/doc/libs/1_61_0/more/getting_started/windows.html" rel="nofollow">Getting Started Guide</a>, but even though I am linking the required libraries, I am getting some unresolved external symbols:</p>
  
  <blockquote>
  <pre><code>1&gt;------ Build started: Project: Project1, Configuration: Debug Win32 ------
  1&gt;  main.cpp
  1&gt;main.obj : error LNK2019: unresolved external symbol "public: void __thiscall boost::re_detail_106100::raw_storage::resize(unsigned int)" (?resize@raw_storage@re_detail_106100@boost@@QAEXI@Z) referenced in function "public: void * __thiscall boost::re_detail_106100::raw_storage::extend(unsigned int)" (?extend@raw_storage@re_detail_106100@boost@@QAEPAXI@Z)
  1&gt;main.obj : error LNK2019: unresolved external symbol "public: void * __thiscall boost::re_detail_106100::raw_storage::insert(unsigned int,unsigned int)" (?insert@raw_storage@re_detail_106100@boost@@QAEPAXII@Z) referenced in function "public: struct boost::re_detail_106100::re_syntax_base * __thiscall boost::re_detail_106100::basic_regex_creator&lt;char,struct boost::regex_traits&lt;char,class boost::cpp_regex_traits&lt;char&gt; &gt; &gt;::insert_state(int,enum boost::re_detail_106100::syntax_element_type,unsigned int)" (?insert_state@?$basic_regex_creator@DU?$regex_traits@DV?$cpp_regex_traits@D@boost@@@boost@@@re_detail_106100@boost@@QAEPAUre_syntax_base@23@HW4syntax_element_type@23@I@Z)
  1&gt;C:\Users\unknown\Documents\Visual Studio 2015\Projects\Project1\Debug\Project1.exe : fatal error LNK1120: 2 unresolved externals
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  </code></pre>
  </blockquote>
  
  <p>Here is the code (taken from <a href="http://www.boost.org/doc/libs/1_61_0/more/getting_started/windows.html" rel="nofollow">here</a>):</p>
  
  <pre><code>#include &lt;boost/regex.hpp&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  int main()
  {
      std::string line;
      boost::regex pat("^Subject: (Re: |Aw: )*(.*)");
  
      while (std::cin)
      {
          std::getline(std::cin, line);
          boost::smatch matches;
          if (boost::regex_match(line, matches, pat))
              std::cout &lt;&lt; matches[2] &lt;&lt; std::endl;
      }
  }
  </code></pre>
  
  <p>Some information:</p>
  
  <ul>
  <li>This happens under Debug and Release</li>
  <li>I can't build the project under x64, because the libraries are x86</li>
  <li>I built the static library using <code>bootstrap</code>, then <code>b2</code></li>
  <li>I included <code>libboost_regex-vc140-mt-1_61.lib</code> (<code>libboost_regex-vc140-mt-gd-1_61.lib</code> for Debug)</li>
  <li>Not using Unicode character set (in Visual Studio project properties)</li>
  <li>I am using Visual Studio 2015</li>
  <li>I am using Boost 1.61</li>
  <li>This happens for <em>every</em> Boost code that requires a library</li>
  <li>This obviously doesn't happen for header only Boost libraries</li>
  </ul>
  
  <p>Any ideas?</p>