title: Boost Python Hello World example not working in Python
body: <p>I'm having a great deal of trouble using my c++ code from Visual C++ (wrapped by boost) in Python.</p>
  
  <p>Alright, so the tools I'm using are: Visual Studio 2010, BoostPro 1_47, Windows 7, and Python 2.7 (32-bit). </p>
  
  <p>I have the following code which compiles nicely in Visual Studio 2010:</p>
  
  <pre><code>#define BOOST_PYTHON_STATIC_LIB
  #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's in the format: Win32 Console Application >>>Empty Project / DLL.</p>
  
  <p>In "Project Properties":</p>
  
  <pre><code>VC++ DIRECTORIES: 
    I added:  
    &gt;&gt;&gt; INCLUDE DIRECTORIES:  C:\Program Files\boost\boost_1_47;C:\Python27\include        .  
    &gt;&gt;&gt; LIBRARY DIRECTORIES:  C:\Program Files\boost\boost_1_47\lib;C:\Python27\libs
  </code></pre>
  
  <p>All of this makes the c++ file build but then I can't access it from Python. </p>
  
  <p>This is what Python says when I try to use the module:</p>
  
  <pre><code>"&gt;&gt;&gt; import hello
   Traceback (most recent call last):
     File "&lt;pyshell#0&gt;", line 1, in &lt;module&gt;
       import hello
   ImportError: No module named hello
  </code></pre>
  
  <p>So I guess my question is... How can I get Python to find it???</p>
  
  <p>When the c++ code compiles it creates a DLL file. Do I have to change the location of the file? If so, where should I put it?</p>
  
  <p>Your help would be greatly appreciated</p>