I would like to use Boost.python on a Win7 machine for a python 3.4 project that will connect to our C++ DLL. I'm working my way through the boost.python tutorial and cannot get it to work (see step 14 below). I don't think this issue is related to python 3.4 but something easier (missing path settings in the Visual Studio Command Prompt). I can't figure out how to fix it! Help!
Here are the details of what I'm doing:
As I said it's a Win7 (virtual) Machine and I'm trying to run with 32 bit python/Visual studio. I do have python 3.4 installed and in the path...
Starting from this discussion: How to use Boost in Visual Studio 2010
I do the following:
- Start Visual Studio 2010 Command Prompt:
Menu->Programs->Microsoft Visual Studio 2010->Visual Studio Tools->Visual Studio Command Prompt
cd C:\Boost\boost_1_55_0
bootstrap
b2 toolset=msvc-10.0 --build-type=complete --with-python --libdir=C:\Boost\lib\i386 install
Initial warninglink.jam: No such file or directory
C:\Boost\boost_1_55_0>dir C:\Boost\lib\i386 Volume in drive C has no label. Volume Serial Number is BCA0-48C6 Directory of C:\Boost\lib\i386 06/19/2014 11:45 AM <DIR> . 06/19/2014 11:45 AM <DIR> .. 06/19/2014 11:45 AM 217,088 boost_python-vc100-1_55.dll 06/19/2014 11:45 AM 188,908 boost_python-vc100-1_55.lib 06/19/2014 11:43 AM 496,640 boost_python-vc100-gd-1_55.dll 06/19/2014 11:43 AM 190,156 boost_python-vc100-gd-1_55.lib 06/19/2014 11:42 AM 217,088 boost_python-vc100-mt-1_55.dll 06/19/2014 11:42 AM 190,156 boost_python-vc100-mt-1_55.lib 06/19/2014 11:25 AM 496,640 boost_python-vc100-mt-gd-1_55.dll 06/19/2014 11:25 AM 191,452 boost_python-vc100-mt-gd-1_55.lib 06/19/2014 11:30 AM 5,757,576 libboost_python-vc100-1_55.lib 06/19/2014 11:29 AM 22,050,448 libboost_python-vc100-gd-1_55.lib 06/19/2014 11:24 AM 5,758,472 libboost_python-vc100-mt-1_55.lib 06/19/2014 11:23 AM 22,051,792 libboost_python-vc100-mt-gd-1_55.lib 06/19/2014 11:32 AM 6,247,162 libboost_python-vc100-mt-s-1_55.lib 06/19/2014 11:31 AM 21,969,684 libboost_python-vc100-mt-sgd-1_55.lib 06/19/2014 11:35 AM 6,246,266 libboost_python-vc100-s-1_55.lib 06/19/2014 11:33 AM 21,968,340 libboost_python-vc100-sgd-1_55.lib 16 File(s) 114,237,868 bytes 2 Dir(s) 14,676,119,552 bytes free
Open Visual Studio 2010 and create New "Empty project" called
Python.Boost
- Right Click on
Property Manager->Release|Win32->Microsoft.Cpp.Win32.user
and selectProperties
- Select 'VC++ Directories'
- Edit the 'Include Directories' to add
C:\Boost\include\boost_1_55_0\boost;C:\Python34\include
- Edit the 'Library Directories' to add
C:\Boost\lib\i386;C:\Python34\libs
- Following instructions from here: http://www.boost.org/doc/libs/1_55_0/libs/python/doc/tutorial/doc/html/python/hello.html
Create
user-config.jam
in home directory with following content:# MSVC configuration using msvc : 10.0 ; # Python configuration: using python : 3.4 : C:\\Python34 : C:\\Python34\\include : C:\\Python34\\libs ;
Open a Windows Command Prompt (started from Python.Boost project through Tools->Visual Studio Command Prompt
cd C:\Boost\boost_1_55_0\libs\python\example\tutorial
bjam
C:\Boost\boost_1_55_0\libs\python\example\tutorial> bjam link.jam: No such file or directory ...patience... ...patience... ...found 1685 targets... ...updating 6 targets... msvc.link.dll bin\msvc-10.0\debug\hello_ext.pyd LINK : fatal error LNK1104: cannot open file 'boost_python-vc100-mt-gd-1_55.lib' call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >nul link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /MACHINE:X86 /MANIFEST /subsystem:console /out:"bin\msvc-10.0\debug\hello_ext.pyd" /IMPLIB:"bin\msvc-10.0\debug\hello_ext.lib" /LIBPATH:"C:\Python34\libs" @"bin\msvc-10.0\debug\hello_ext.pyd.rsp" if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL% ...failed msvc.link.dll bin\msvc-10.0\debug\hello_ext.pyd bin\msvc-10.0\debug\hello_ext.lib bin\msvc-10.0\debug\hello_ext.pdb bin\msvc-10.0\debug\hello_ext.pdb... ...removing bin\msvc-10.0\debug\hello_ext.pdb ...skipped <p.>hello_ext.pyd for lack of <pbin\msvc-10.0\debug>hello_ext.pyd... ...failed updating 2 targets... ...skipped 1 target...
What am I missing? Seems like the paths are not set as expected? Help appreciated!