Boost Python hello示例给出了错误。

Boost Python hello示例给出了错误。,python,boost,boost-python,bjam,Python,Boost,Boost Python,Bjam,我一直在尝试让Boost.Python运行。我正在遵循这里提到的步骤 。然而,当我试图从教程目录运行一个示例程序时,我得到了以下错误。此外,python脚本hello.py也将被删除。我如何得到2个我似乎无法纠正的错误 C:\boost_1_50_0\libs\python\example\tutorial>b2 notice: no Python configured in user-config.jam notice: will use default configuratio

我一直在尝试让Boost.Python运行。我正在遵循这里提到的步骤

。然而,当我试图从教程目录运行一个示例程序时,我得到了以下错误。此外,python脚本hello.py也将被删除。我如何得到2个我似乎无法纠正的错误

   C:\boost_1_50_0\libs\python\example\tutorial>b2
notice: no Python configured in user-config.jam
notice: will use default configuration
...patience...
...patience...
...found 1621 targets...
...updating 20 targets...
common.mkdir bin
common.mkdir bin\hello.test
common.mkdir bin\hello.test\msvc-10.0
common.mkdir bin\hello.test\msvc-10.0\debug
common.mkdir bin\hello.test\msvc-10.0\debug\threading-multi
copy hello.py
**The syntax of the command is incorrect.

    copy /b  + this-file-does-not-exist-A698EE7806899E69 "hello.py" "bin\hello.t
est\msvc-10.0\debug\threading-multi\hello.py"

...failed copy hello.py bin\hello.test\msvc-10.0\debug\threading-multi\hello.py.
..
...removing hello.py**
common.mkdir bin\msvc-10.0
common.mkdir bin\msvc-10.0\debug
common.mkdir bin\msvc-10.0\debug\threading-multi
compile-c-c++ bin\msvc-10.0\debug\threading-multi\hello.obj
hello.cpp
msvc.link.dll ..\..\..\..\bin.v2\libs\python\build\msvc-10.0\debug\threading-mul
ti\boost_python-vc100-mt-gd-1_50.dll
**LINK : fatal error LNK1104: cannot open file 'python32.lib'**

        call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.b
at" x86 >nul
link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /MACHINE:X86 /subsystem:console /out:".
.\..\..\..\bin.v2\libs\python\build\msvc-10.0\debug\threading-multi\boost_python
-vc100-mt-gd-1_50.dll" /IMPLIB:"..\..\..\..\bin.v2\libs\python\build\msvc-10.0\d
ebug\threading-multi\boost_python-vc100-mt-gd-1_50.lib" /LIBPATH:"C:\Python33\li
bs"   @"..\..\..\..\bin.v2\libs\python\build\msvc-10.0\debug\threading-multi\boo
st_python-vc100-mt-gd-1_50.dll.rsp"
        if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

...failed msvc.link.dll ..\..\..\..\bin.v2\libs\python\build\msvc-10.0\debug\thr
eading-multi\boost_python-vc100-mt-gd-1_50.dll ..\..\..\..\bin.v2\libs\python\bu
ild\msvc-10.0\debug\threading-multi\boost_python-vc100-mt-gd-1_50.lib ..\..\..\.
.\bin.v2\libs\python\build\msvc-10.0\debug\threading-multi\boost_python-vc100-mt
-gd-1_50.pdb...
...skipped <pbin\msvc-10.0\debug\threading-multi>hello_ext.pyd for lack of <p..\
..\..\..\bin.v2\libs\python\build\msvc-10.0\debug\threading-multi>boost_python-v
c100-mt-gd-1_50.lib...
.......
.......

...failed updating 4 targets...
...skipped 7 targets...
...updated 9 targets...

C:\boost_1_50_0\libs\python\example\tutorial>
我安装了Python32的旧版本,但它似乎一直在搜索它。我的PYTHON_INLCUDE和PYTHON_库都指向新的PYTHON和PATH环境变量

C:\boost_1_50_0\libs\python\example\tutorial> echo %python_lib%\
C:\Python33\libs\python33.lib\

C:\boost_1_50_0\libs\python\example\tutorial> echo %python_include%\
C:\Python33\include\

C:\boost_1_50_0\libs\python\example\tutorial>
为什么hello.py文件不断被删除:(以及systax不正确的内容)我昨天在编译Boost 1.53时遇到了同样的问题(“命令的语法不正确”)。我能够通过编辑文件tools/build/v2/tools/common.jam来解决这个问题:

--- common.jam~ 2012-04-25 21:35:54.000000000 +0200
+++ common.jam  2013-03-07 13:33:30.985604300 +0100
@@ -473,7 +473,7 @@
     # destination to the current time by concatenating the
     # source with a nonexistent file.  Note that this requires
     # /b (binary) as the default when concatenating files is /a (ascii).
-    WINDOWS-CP-HACK = "+ this-file-does-not-exist-A698EE7806899E69" ;
+    WINDOWS-CP-HACK = "" ;
 }
 else
 {

您必须设置configurate您的user-config.jam文件。看起来Boost.Python只能找到您的Python 3.2版本。您可以在主目录(ECHO%HOMEDRIVE%%HOMEPATH%)中找到user-config.jam文件,或者在Boost根目录中搜索“user-config.jam”文件

然后,您必须修改此文件以供使用,如下所示(这只是一个示例):

MSVC配置(如果使用MSVC)

以及Python配置

# ---------------------
# Python configuration.
# ---------------------

# Configure specific Python version.
# using python : 3.1 : /usr/bin/python3 : /usr/include/python3.1 : /usr/lib ;

using python 
    : 2.5                   # Version
    : C:\\app\\tools\\Python25\\python.exe      # Python Path
    : C:\\app\\tools\\Python25\\include         # include path
    : C:\\app\\tools\\Python25\\libs            # lib path(s)
    : <define>BOOST_ALL_NO_LIB=1
    ;
#---------------------
#Python配置。
# ---------------------
#配置特定的Python版本。
#使用python:3.1:/usr/bin/python3:/usr/include/python3.1:/usr/lib;
使用python
:2.5#版本
:C:\\app\\tools\\Python25\\python.exe\python路径
:C:\\app\\tools\\Python25\\include#include路径
:C:\\app\\tools\\Python25\\libs\lib路径
:BOOST\u ALL\u NO\u LIB=1
;
# -------------------
# MSVC configuration.
# -------------------

# Configure msvc (default version, searched for in standard locations and PATH).
# using msvc ;

# Configure specific msvc version (searched for in standard locations and PATH).
using msvc : 10.0 : C:\\app\\tools\\MSVisualStudio2010\\VC\\bin\\cl.exe ;
# ---------------------
# Python configuration.
# ---------------------

# Configure specific Python version.
# using python : 3.1 : /usr/bin/python3 : /usr/include/python3.1 : /usr/lib ;

using python 
    : 2.5                   # Version
    : C:\\app\\tools\\Python25\\python.exe      # Python Path
    : C:\\app\\tools\\Python25\\include         # include path
    : C:\\app\\tools\\Python25\\libs            # lib path(s)
    : <define>BOOST_ALL_NO_LIB=1
    ;