title: Boost Python : Having problems importing a module
body: <p>I'm currently trying to use Boost Python to export a class, and then use it in the corresponding the program. </p>
  
  <pre><code>/**
      main.cpp
  */
  #define BOOST_PYTHON_STATIC_LIB
  #include &lt;Resource\ZipResourceFile.hpp&gt;
  #include &lt;Resource\ResourceCache.hpp&gt;
  #include &lt;Windows.h&gt;
  #include &lt;boost/python.hpp&gt;
  #include &lt;iostream&gt;
  
  /* a simple add method, for s &amp; g's */
  int add(int a, int b)
  {
      return a + b;
  }
  
  /* Foo class*/
  class Foo
  {
  public:
      Foo(int n);
      ~Foo();
      void f();
  };
  
  /* Foo ctor, does nothingm just wanted to pass and arg */
  Foo::Foo(int n)
  {
  
  }
  
  /* destructor */
  Foo::~Foo()
  {
  }
  
  /* f() implementation, calls Foo!!! to cout */
  void Foo::f()
  {
      std::cout &lt;&lt; "Foo!!!" &lt;&lt; '\n';
  }
  
  /* Boost python module definition */
  BOOST_PYTHON_MODULE(PyBackend)
  {
      using namespace boost::python;
  
      def("add", add);
      class_&lt;Foo&gt;("Foo", init&lt;int&gt;())
          .def("f", &amp;Foo::f);
  }
  
  
  
  int main(int argc, char* argv[])
  {
      PyImport_AppendInittab("PyBackend", init_PyBackend);
      Py_Initialize();
      PyRun_SimpleString("import PyBackend");
      PyRun_SimpleString("foo = PyBackend.Foo(1)");
  
      Py_Finalize();
  
      {
          int n;
          std::cin &gt;&gt; n;
      }
      return 0;
  }
  </code></pre>
  
  <p>Anyhow, I have no idea where i can find the function init_PyBackend, even though that seems the logical thing I would call if I wasn't using Boost.Python.</p>
  
  <p>The module itself isn't in a seperate DLL, it's compiled all at the same time. Anyway, anyone have any ideas on what I can do?</p>