【发布时间】:2015-03-14 19:21:28
【问题描述】:
我只是想按照here 的说明来让快速入门示例正常工作。我在 Windows 7 上并尝试使用 MSVC。我已经安装了 Python 2.7。
我做了什么:
- 下载 boost_1_57_0.zip 并解压到
C:\boost_1_57_0。 -
从
C:\boost_1_57_0中的命令提示符运行:bootstrap然后:
.\b2按照 5.1 here 下的说明。在此之后,我有一条消息说“Boost C++ 库已成功构建!”。
- 将
C:\boost_1_57_0添加到我的路径中。说明并没有说要这样做,但由于他们希望我调用 bjam,而这就是它所在的地方,我认为我需要这样做。 - 修改
C:\boost_1_57_0\libs\python\example\quickstart\boost-build.jam,使路径为boost-build ../../../../tools/build/src ;而不是boost-build ../../../../tools/build/v2 ;。这是按照here 的说明进行的,因为原始路径是错误的,如果您不这样做,则 bjam 调用将失败。 -
CD 进入
C:\boost_1_57_0\libs\python\example\quickstart并运行:bjam toolset=msvc --verbose-test test
我得到的输出首先是:
...patience...
...patience...
...found 1926 targets...
...updating 55 targets...
common.mkdir bin
common.mkdir bin\test_ext.test
common.mkdir bin\test_ext.test\msvc-12.0
common.mkdir bin\test_ext.test\msvc-12.0\debug
common.mkdir bin\test_ext.test\msvc-12.0\debug\threading-multi
common.mkdir bin\msvc-12.0
common.mkdir bin\msvc-12.0\debug
common.mkdir bin\msvc-12.0\debug\threading-multi
compile-c-c++ bin\msvc-12.0\debug\threading-multi\extending.obj
extending.cpp
c:\python27\include\pymath.h(22) : warning C4273: 'round' : inconsistent dll linkage
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(516) : see previous definition of 'round'
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xtgmath.h(190) : warning C4273: '_hypot' : inconsistent dll linkage
接着是一长串其他头文件条目,每个都抱怨 dll 链接不一致,最后是一堆错误,其中亮点包括:
LINK : fatal error LNK1207: incompatible PDB format in 'C:\boost_1_57_0\libs\python\example\quickstart\bin\msvc-12.0\debug\threading-multi\extending.pdb'; delete and rebuild
...failed msvc.link.dll bin\msvc-12.0\debug\threading-multi\extending.pyd bin\msvc-12.0\debug\threading-multi\extending.pdb...
...removing bin\msvc-12.0\debug\threading-multi\extending.pdb
LINK : warning LNK4001: no object files specified; libraries used
LINK : error LNK2001: unresolved external symbol _mainCRTStartup
bin\test_embed.test\msvc-12.0\debug\threading-multi\test_embed.exe : fatal error LNK1120: 1 unresolved externals
...failed msvc.link bin\test_embed.test\msvc-12.0\debug\threading-multi\test_embed.exe bin\test_embed.test\msvc-12.0\debug\threading-multi\test_embed.pdb...
...removing bin\test_embed.test\msvc-12.0\debug\threading-multi\test_embed.pdb
...skipped <pbin\test_embed.test\msvc-12.0\debug\threading-multi>test_embed.run for lack of <pbin\test_embed.test\msvc-12.0\debug\threading-multi>test_embed.exe...
...failed updating 4 targets...
有什么想法吗?
【问题讨论】:
标签: python c++ visual-c++ boost boost-python