title: Boost Python class export fails to compile with linking error in visual studio 2013
body: <p>I compiled Boost myself and used it to export the following function to a DLL :</p>
  
  <pre><code>#include &lt;boost/python.hpp&gt;
  using namespace boost::python;
  
  std::string greet()
  {
      return "hello, dude !!";
  }
  
  BOOST_PYTHON_MODULE(hello)
  {
      def("greet", greet);
  }
  </code></pre>
  
  <p>This loaded fine in Python after I renamed the hello.dll file to hello.pyd.</p>
  
  <p>Now I am trying this :</p>
  
  <pre><code>#include &lt;boost/python.hpp&gt;
  using namespace boost::python;
  
  struct World
  {
      void set(std::string msg) { this-&gt;msg = msg; }
      std::string greet() { return msg; }
      std::string msg;
  };
  
  
  BOOST_PYTHON_MODULE(hello)
  {
      class_&lt;World&gt;("World")
          .def("greet", &amp;World::greet)
          .def("set", &amp;World::set);
  }
  </code></pre>
  
  <p>It errors out with : </p>
  
  <pre><code>Error   29  error LNK2019: unresolved external symbol "__declspec(dllimport) void * __cdecl boost::python::objects::find_static_type(void *,struct boost::python::type_info,struct boost::python::type_info)" (__imp_?find_static_type@objects@python@boost@@YAPAXPAXUtype_info@23@1@Z) referenced in function "private: virtual void * __thiscall boost::python::objects::value_holder&lt;struct World&gt;::holds(struct boost::python::type_info,bool)" (?holds@?$value_holder@UWorld@@@objects@python@boost@@EAEPAXUtype_info@34@_N@Z) D:\Code\Python\hello\hello\hello.obj    hello
  
  Error   30  error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::python::converter::shared_ptr_deleter::shared_ptr_deleter(struct boost::python::converter::shared_ptr_deleter const &amp;)" (__imp_??0shared_ptr_deleter@converter@python@boost@@QAE@ABU0123@@Z) referenced in function "public: __thiscall boost::shared_ptr&lt;void&gt;::shared_ptr&lt;void&gt;&lt;void,struct boost::python::converter::shared_ptr_deleter&gt;(void *,struct boost::python::converter::shared_ptr_deleter)" (??$?0XUshared_ptr_deleter@converter@python@boost@@@?$shared_ptr@X@boost@@QAE@PAXUshared_ptr_deleter@converter@python@1@@Z) D:\Code\Python\hello\hello\hello.obj    hello
  
  Error   31  error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::python::objects::class_base::~class_base(void)" (__imp_??1class_base@objects@python@boost@@QAE@XZ) referenced in function __unwindfunclet$??0?$class_@UWorld@@Unot_specified@detail@python@boost@@U2345@U2345@@python@boost@@QAE@PBD0@Z$0    D:\Code\Python\hello\hello\hello.obj    hello
  
  Error   32  error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl boost::python::objects::register_dynamic_id_aux(struct boost::python::type_info,struct std::pair&lt;void *,struct boost::python::type_info&gt; (__cdecl*)(void *))" (__imp_?register_dynamic_id_aux@objects@python@boost@@YAXUtype_info@23@P6A?AU?$pair@PAXUtype_info@python@boost@@@std@@PAX@Z@Z) referenced in function "void __cdecl boost::python::objects::register_dynamic_id&lt;struct World&gt;(struct World *)" (??$register_dynamic_id@UWorld@@@objects@python@boost@@YAXPAUWorld@@@Z)  D:\Code\Python\hello\hello\hello.obj    hello
  </code></pre>
  
  <p>This is Visual Studio Express 2013. I compiled my own boost libraries following the exact steps as given here: <a href="http://www.boost.org/doc/libs/1_56_0/doc/html/bbv2/installation.html" rel="nofollow noreferrer">http://www.boost.org/doc/libs/1_56_0/doc/html/bbv2/installation.html</a></p>
  
  <p>I think my build/installation is fine as the global function before this was fine. But maybe there is some incompatibility with MSVC 2012 and 13 because the boost python debug library is named <code>boost_python-vc120-mt-gd-1_56.lib</code>.</p>