<div>I can&#39;t seem to get this to work:</div><div>This little program just embeds python, creates a module using boost, and attempts to add it to the list of built-in modules.</div><div><br></div><div>//-------------------------------------------------------</div>
<div>#include &lt;boost/python.hpp&gt;</div><div>using namespace boost::python;</div><div><br></div><div>char const* greet()</div><div>{</div><div>   return &quot;hello, world&quot;;</div><div>}</div><div><br></div><div>BOOST_PYTHON_MODULE(hello)</div>
<div>{</div><div>    def(&quot;greet&quot;, greet);</div><div>}</div><div><br></div><div>int main()</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>PyImport_AppendInittab(&quot;hello&quot;, inithello);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>Py_Initialize();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>return 0;</div><div>}</div><div>//-------------------------------------------------------</div>
<div><br></div><div>But when I attempt to build using bjam, I get:</div><div><br></div><div>-------------------------------------------------------<br><div>...found 1629 targets...</div><div>...updating 3 targets...</div>
</div><div><div>compile-c-c++ bin\msvc-10.0\debug\threading-multi\BoostPy3DEngine.obj</div><div>BoostPy3DEngine.cpp</div><div>BoostPy3DEngine.cpp(17) : error C2065: &#39;inithello&#39; : undeclared identifier</div></div><div>
<div><br></div><div>    call &quot;C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat&quot; x86 &gt;nul</div><div>cl /Zm800 -nologo @&quot;bin\msvc-10.0\debug\threading-multi\BoostPy3DEngine.obj.rsp&quot;</div>
<div><br></div><div>...failed compile-c-c++ bin\msvc-10.0\debug\threading-multi\BoostPy3DEngine.obj...</div><div>...skipped &lt;pbin\msvc-10.0\debug\threading-multi&gt;BoostPy3DEngine.exe for lack of</div><div> &lt;pbin\msvc-10.0\debug\threading-multi&gt;BoostPy3DEngine.obj...</div>
<div>...skipped &lt;pbin\msvc-10.0\debug\threading-multi&gt;BoostPy3DEngine.pdb for lack of</div><div> &lt;pbin\msvc-10.0\debug\threading-multi&gt;BoostPy3DEngine.obj...</div><div>...failed updating 1 target...</div><div>
...skipped 2 targets...</div></div><div>-------------------------------------------------------</div><div><br></div><div>My understanding is that the BOOST_PYTHON_MODULE macro is supposed to create the inithello function when it builds the hello module... but the compiler doesn&#39;t seem to be able to find it.</div>
<div><div><br></div><div>The above code compiles without complaint if I leave out the line:</div><div>PyImport_AppendInittab(&quot;hello&quot;, inithello);</div></div><div><br></div><div>I am using bjam with the --toolset=msvc switch (its the only way I know how to build with boost).  And I have MSVC version 10.0.30319.1 installed, and this is a Windows XP machine.</div>
<div><br></div><div><div>Anyone know what might be causing the above error?</div></div><div><br></div><div>Thanks for any help you can give!</div><div><br></div><div>-Mike</div>