title: Building/including Boost.Python in VS2013
body: <p>Can someone tell me if I'm doing anything wrong. </p>
  
  <p>I'm on Windows 7 using Visual Studio 2013 and I would like to be able to be able to setup a simple Boost.Python project. I don't know if I've made something wrong <strong>building</strong> boost or when <strong>including</strong> boost in my project. </p>
  
  <p><strong>Error</strong></p>
  
  <p>When I try to <code>#include</code> any boost python module, e.g. <code>#include &lt;boost/python/module.hpp&gt;</code> I get the following error in Visual Studio.</p>
  
  <pre><code>1&gt;c:\boost_1_55_0\boost\python\detail\wrap_python.hpp(50): fatal error C1083: Cannot open include file: 'pyconfig.h': No such file or directory
  </code></pre>
  
  <p><strong>Building</strong></p>
  
  <p>I tried to follow instructions from <a href="https://stackoverflow.com/a/2655683/1937742">this SO thread in which KTC addresses Python</a>, and <a href="http://www.boost.org/doc/libs/1_41_0/libs/python/doc/building.html" rel="nofollow noreferrer">this Python howto from Boost</a>, but since both links are bit dated, are doing things differently, and some of the steps seems to have changed in newer versions of Boost, I had to improvise on some of the instructions.</p>
  
  <p>This is what I did.</p>
  
  <ol>
  <li>Unziped the latest version (1.55) of Boost source file to <code>C:\boost_1_55_0</code>.</li>
  <li>Used <code>cmd.exe</code> to navigate to <code>C:\boost_1_55_0</code>. (I did not use <code>Developer Command Prompt for VS2013</code> found under <code>\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts</code>. This shouldn't make any difference, should it? <a href="http://www.boost.org/doc/libs/1_55_0/more/getting_started/windows.html#prepare-to-use-a-boost-library-binary" rel="nofollow noreferrer">Boosts official guide for 1.55</a> didn't make any specific mentioning of using <code>Command Prompt for VS2013</code>.</li>
  <li>Used <code>bootstrap</code> in cmd.</li>
  <li>Edited <code>project-config.jam</code> (created by <code>bootstrap</code>) and added path to my Python 3.4 installation <code>C:\Python34</code>. My <code>.jam</code> file now looked like as seen in <strong>Project-Config.jam</strong>.</li>
  <li>Used <code>.\b2</code> in cmd to start the build process. While I had a lot of warnings during the built (<code>forcing value to bool 'true' or 'false' (performance warning)</code>, etc.), it didn't seem to be any error messages after the built was finished.</li>
  </ol>
  
  <p><strong>Including</strong></p>
  
  <p>This is how I created my project in Visual Studio.</p>
  
  <ol>
  <li>Created a new project.</li>
  <li>Added code as seen in <strong>Test Code</strong>.</li>
  <li>Under VC++ Directories in Project Properties:
  
  <ol>
  <li>Added <code>C:\boost_1_55_0</code> to <code>Include Directories</code>.</li>
  <li>Added <code>C:\boost_1_55_0\stage\lib</code> (the folder where I could find <code>.lib</code> files) to <code>Library Directories</code>.</li>
  </ol></li>
  </ol>
  
  <hr>
  
  <p><strong>Project-Config.jam</strong></p>
  
  <pre><code>import option ; 
  
  using msvc ; 
  
  option.set keep-going : false ; 
  
  using python : 3.4 : C:\\Python34\\python ;
  </code></pre>
  
  <p><strong>Test Code</strong></p>
  
  <p>From: <code>boost_1_55_0\libs\python\example\getting_started1.cpp</code></p>
  
  <pre><code>#include &lt;boost/python/module.hpp&gt;
  #include &lt;boost/python/def.hpp&gt;
  #include &lt;string&gt;
  
  namespace 
  { 
      // A couple of simple C++ functions that we want to expose to Python.
      std::string greet() { return "hello, world"; }
      int square(int number) { return number * number; }
  }
  
  namespace python = boost::python;
  
  BOOST_PYTHON_MODULE(getting_started1)
  {
      // Add regular functions to the module.
      python::def("greet", greet);
      python::def("square", square);
  }
  </code></pre>