我绝对不是专家,所以请原谅我的无知,如果它真的很愚蠢。
我正在尝试使用this tutorial构建bjam版本的debug
我已经在我的文件夹中构建了boost::python。生成有效,Python 3.3.0C:\Development\Python-3.3.0.lib都存在于.dll文件夹中。我测试了口译员,它工作正常。
我正在使用以下命令行:

bjam --user-config=user-config.jam --with-python python-debugging=on threading=multi variant=debug link=shared stage

我的问题来自.exe。我尝试遵循教程的规范,使用了以下内容:
using python : 3.3 : C:\\Development\\Python-3.3.0\\PCBuild\\python_d.exe
    : C:\\Development\\Python-3.3.0\\Include C:\\Development\\Python-3.3.0\\PC
    : C:\\Development\\Python-3.3.0\\PCBuild
    : <python-debugging>on ;

但是链接失败了…出于某种原因,我似乎不想让它使用3.3,下面是输出日志的一部分:
...updating 10 targets...
msvc.link.dll bin.v2\libs\python\build\msvc-11.0\debug\python-debugging-on\threa
ding-multi\boost_python-vc110-mt-gyd-1_52.dll
LINK : fatal error LNK1104: cannot open file 'python26_d.lib'

        call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.b
at" x86 >nul
link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /MACHINE:X86 /subsystem:console /out:"b
in.v2\libs\python\build\msvc-11.0\debug\python-debugging-on\threading-multi\boos
t_python-vc110-mt-gyd-1_52.dll" /IMPLIB:"bin.v2\libs\python\build\msvc-11.0\debu
g\python-debugging-on\threading-multi\boost_python-vc110-mt-gyd-1_52.lib" /LIBPA
TH:"C:\Development\Python-3.3.0\PCBuild"   @"bin.v2\libs\python\build\msvc-11.0\
debug\python-debugging-on\threading-multi\boost_python-vc110-mt-gyd-1_52.dll.rsp
"

我试着修改PCBuild一开始,我没有逃过user-config.jam,令人惊讶的是,它发现我想要构建3.3,但是user-config.jam是错误的(没有反斜杠):
...updating 10 targets...
msvc.link.dll bin.v2\libs\python\build\msvc-11.0\debug\python-debugging-on\threa
ding-multi\boost_python-vc110-mt-gyd-1_52.dll
LINK : fatal error LNK1181: cannot open input file 'python33_d.lib'

        call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.b
at" x86 >nul
link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /MACHINE:X86 /subsystem:console /out:"b
in.v2\libs\python\build\msvc-11.0\debug\python-debugging-on\threading-multi\boos
t_python-vc110-mt-gyd-1_52.dll" /IMPLIB:"bin.v2\libs\python\build\msvc-11.0\debu
g\python-debugging-on\threading-multi\boost_python-vc110-mt-gyd-1_52.lib" /LIBPA
TH:"C:DevelopmentPython-3.3.0PCBuild"   @"bin.v2\libs\python\build\msvc-11.0\deb
ug\python-debugging-on\threading-multi\boost_python-vc110-mt-gyd-1_52.dll.rsp"

如您所见,它正在寻找所需的\,但/LIBPATH不包含python33_d.lib。我还尝试用/LIBPATH替换它,这又回到尝试链接\
如果有用的话,我卸载了以前安装的任何Python版本。
如何使我的/文件正确地需要3.3版并提供正确的路径?
编辑:多弹一点,我删除了python26_d.lib之前的“空格”…这样做可以让它寻找正确的版本,但是它试图将发布版本从一个相对的文件夹链接起来…最坏的情况是我不介意把libs从jam复制到;
using python : 3.3 : C:\\Development\\Python-3.3.0\\PCBuild\\python_d.exe
    : C:\\Development\\Python-3.3.0\\Include C:\\Development\\Python-3.3.0\\PC
    : C:\\Development\\Python-3.3.0\\PCBuild
    : <python-debugging>on;

有趣的是,这是最接近我想要达到的目标,但是它输出了
C:\Development\boost_1_52_0\boost_1_52_0\user-config.jam:4: syntax error at EOF

3.3解析器似乎相当弱…任何提示或提示都会有帮助
编辑2:为了简化问题,我将libs更改为只包含:
using python : 3.3 ;

并使用以下命令行:
bjam --user-config=user-config.jam --with-python threading=multi variant=release link=shared stage

如所料,它找不到PCBuild
...updating 4 targets...
msvc.link.dll bin.v2\libs\python\build\msvc-11.0\release\threading-multi\boost_p
ython3-vc110-mt-1_52.dll
LINK : fatal error LNK1181: cannot open input file 'python33.lib'

        call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.b
at" x86 >nul
link /NOLOGO /INCREMENTAL:NO /DLL /MACHINE:X86 /subsystem:console /out:"bin.v2\l
ibs\python\build\msvc-11.0\release\threading-multi\boost_python3-vc110-mt-1_52.d
ll" /IMPLIB:"bin.v2\libs\python\build\msvc-11.0\release\threading-multi\boost_py
thon3-vc110-mt-1_52.lib" /LIBPATH:"C:\Development\Python-3.3.0\libs"   @"bin.v2\
libs\python\build\msvc-11.0\release\threading-multi\boost_python3-vc110-mt-1_52.
dll.rsp"

所以我决定将我的libs文件夹克隆到jam中,这样我构建的所有lib都可以访问但这样做之后,在不更改user-config.jam或命令行的情况下它现在正在寻找Python2.6?!?
...updating 4 targets...
msvc.link.dll bin.v2\libs\python\build\msvc-11.0\release\threading-multi\boost_p
ython3-vc110-mt-1_52.dll
LINK : fatal error LNK1104: cannot open file 'python26.lib'

        call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.b
at" x86 >nul
link /NOLOGO /INCREMENTAL:NO /DLL /MACHINE:X86 /subsystem:console /out:"bin.v2\l
ibs\python\build\msvc-11.0\release\threading-multi\boost_python3-vc110-mt-1_52.d
ll" /IMPLIB:"bin.v2\libs\python\build\msvc-11.0\release\threading-multi\boost_py
thon3-vc110-mt-1_52.lib" /LIBPATH:"C:\Development\Python-3.3.0\libs"   @"bin.v2\
libs\python\build\msvc-11.0\release\threading-multi\boost_python3-vc110-mt-1_52.
dll.rsp"

我越是深陷其中,就越是困惑…另外,一个用.lib失败,另一个用PCBuild失败。

最佳答案

好吧,我最终决定去掉bjam中所有可能的参数,从头开始构建。我终于用这个命令行构建了所有可能的目标:

 bjam --user-config=user-config.jam --with-python

其中bjam仅包含以下内容:
using python : 3.3 : C:\\Development\\Python-3.3.0\\PCBuild\\python.exe
    : C:\\Development\\Python-3.3.0\\Include C:\\Development\\Python-3.3.0\\PC
    : C:\\Development\\Python-3.3.0\\PCBuild : ;

现在看来运转正常了。
谢谢

10-04 14:41