Hi<br>I have just started to see wrapping C++/Python and choose to use boost.Python libs and further Py++ once mastered boost.Python.<br><br>So I read their tutorial introduction : <a href="http://www.boost.org/doc/libs/1_35_0/libs/python/doc/tutorial/doc/html/index.html">http://www.boost.org/doc/libs/1_35_0/libs/python/doc/tutorial/doc/html/index.html</a><br>
<br>Ok so i install Boost and choose Python lib at setup and msvc 8.0 as compiler. (got 2005 express version).<br>Boost has been installed in this abs path : C:\Program Files\boost\boost_1_35_0<br><br>Then i build the BJam tools usign the .bat isued with the Boost.Python package.<br>
I add the path in PATH Env Var.<br><br>Next and prior to use the bjam command in the tutorial directory (where hello.cpp, hello.py and Jamroot files are) <br>i modified the user-config.jam file according to the tutorial :<br>
This file is located in : C:\Program Files\boost\boost_1_35_0\tools\build\v2<br>here is&nbsp; the modifications :<br><br>i added this :<br>#&nbsp; Configure msvc (default version, searched in standard location<br>#&nbsp; and PATH).<br>&nbsp; using msvc : 8.0 ;<br>
<br>and this :<br>#&nbsp; Python configuration<br>using python : 2.5 : C:/Python25 ;<br><br>the rest of the file hasn&#39;t change at all.<br><br>I doesn&#39;t touch the Jamroot file either <br><br>( **** note you can ignore the following it is another minor issue : ****<br>
<br>ok it is not totally right : i wish to change the default use-project rule from : <br>use-project boost <br>&nbsp; : ../../../.. ;&nbsp;&nbsp; =&gt; default one<br>to<br>use-project boost<br>&nbsp; : &quot;$(BOOST_ROOT)&nbsp; ;<br><br>where BOOST_ROOT is a user Env Var which store the path : C:\Program Files\boost\boost_1_35_0<br>
<br>But that doesn&#39;t build using bjam command : the following error happend :<br>*** argument error<br>* rule use-project ( id : where )<br>* called with: ( boost :&nbsp; )<br>* missing argument where<br><br>so finally i changed it to <br>
<br>use-project boost<br>&nbsp; : &quot;C:/Program Files/boost/boost_1_35_0&quot; ;<br><br>but i would rather use the Env Var if possible <br><br>&nbsp;**** end of the minor issue description **** )<br><br>so ok I launched bjam and after a while it finnished building the lib files, and make me use the param <b>--preserve-test-targets</b> to bjam as indicated in the tutorial for the 1.35 version.<br>
<br>&nbsp;--&gt; But the problem is that usign hello.py doesn&#39;t work due to the fact the library weren&#39;t found by python.<br><br>Indeed the libs are generated in this paths :<br>C:\Program Files\boost\boost_1_35_0\bin.v2\libs\python\build\msvc-8.0\debug\threading-multi\boost_python-vc80-mt-gd-1_35.dll<br>
and :<br>C:\Program Files\boost\boost_1_35_0\libs\python\example\tutorial\bin\msvc-8.0\debug\threading-multi\hello_ext.exp<br>C:\Program Files\boost\boost_1_35_0\libs\python\example\tutorial\bin\msvc-8.0\debug\threading-multi\hello_ext.pyd<br>
C:\Program Files\boost\boost_1_35_0\libs\python\example\tutorial\bin\msvc-8.0\debug\threading-multi\hello_ext.lib<br><br>There is no way Python are aware of this new Libs !<br>Maybe i wrong but i though that bjam automated the creation of the library for python and put the files where they need to be,<br>
A clue of this is the fact that we needed to add :<br>#&nbsp; Python configuration<br>
using python : 2.5 : C:/Python25 ;<br>in the user-config.jam file, so i guessed that bjam would create automatically the directory of the new module and put the libs there.<br><br>In order to make it work i had to copying the hello_ext.lib file to the Python lib directory : C:\Python25\libs<br>
<br>and i had to create manually this directory :<br>C:\Python25\Lib\site-packages\hello_ext<br>In this directory I copied our libs files :<br>hello_ext.exp<br>hello_ext.pyd<br>boost_python-vc80-mt-gd-1_35.dll<br>And create also another file : __init__.py that contain the following :<br>
<br>import sys<br><br>sys.path.append(&#39;..\..&#39;)<br><br># this brings in the DLL (pyd)<br>from hello_ext import *<br><br>And after this the new module was known from python and <br>hello.py work !<br>to sum up : does bjam automatically generate the module directory and plant in the lib needed (and the __init__.py file) as I though it was<br>
Or does i need to do this manually (and create another script/make like file to automatize this) ?<br><br><br>Note 1 : this not my idea, in order to resolve my issue i found this on the web wich is a similar case :<br><a href="http://mail.python.org/pipermail/c++-sig/2007-November/013059.html">http://mail.python.org/pipermail/c++-sig/2007-November/013059.html</a><br>
/Note 1<br><br><br>Note 2 : in this thread one advise to modified the Jamroot file and add this :<br><pre># Declare a Python extension<br>python-extension _**name of ext goes here** # Declare a Python extension<br>  : **name of CPP with wrapper class(es) goes here**    # Source<br>
  : &lt;include&gt;**your includes go here**<br>    &lt;define&gt;**your defines go here**<br>  : &lt;library-path&gt;**your lib path goes here**&lt;library-path&gt;$(BOOST_ROOT)/stage/lib<br>  ;</pre>so i putted this :<br>
<pre># Declare a Python extension<br>python-extension hello_ext # Declare a Python extension<br>  : hello.cpp    # Source<br>  #: &lt;include&gt;**your includes go here**<br>  #  &lt;define&gt;**your defines go here**<br>
  #: &lt;library-path&gt;**your lib path goes here**<br>  &lt;library-path&gt;$(BOOST_ROOT)/stage/lib<br>  ;<br></pre>But bjam doesn&#39;t work anymore (some error that imply some core .jam file that is not from me) so I removed this and return to the the default vesion :<br>
# Declare the three extension modules.&nbsp; You can specify multiple<br># source files after the colon separated by spaces.<br>python-extension hello_ext : hello.cpp ;<br>/Note 2<br><br><br>THANKs for considering this post, a little long ^^ and excuse my english ;)<br>
<br>MAIGNAN Aurélien<br>