boost:python安装时出错:(
按照这里所说:
http://www.boost.org/doc/libs/1_42_0/libs/python/doc/building.html
》》》
C:\boost_1_34_0\…\quickstart> bjam toolset=msvc --verbose-test test
我增加了一个参数--with-python
结果如下:
C:\Program Files\boost\boost_1_42\libs\python\example\quickstart>bjam --with-pyt
hon toolset=msvc --verbose-test test
...patience...
...patience...
...found 1554 targets...
...updating 22 targets...
common.mkdir bin
common.mkdir bin\test_ext.test
common.mkdir bin\test_ext.test\msvc-7.1
common.mkdir bin\test_ext.test\msvc-7.1\debug
common.mkdir bin\test_ext.test\msvc-7.1\debug\threading-multi
common.mkdir bin\msvc-7.1
common.mkdir bin\msvc-7.1\debug
common.mkdir bin\msvc-7.1\debug\threading-multi
compile-c-c++ bin\msvc-7.1\debug\threading-multi\extending.obj
extending.cpp
msvc.link.dll bin\msvc-7.1\debug\threading-multi\extending.pyd
正在创建库 bin\msvc-7.1\debug\threading-multi\extending.lib 和对象 bin\msvc-7
.1\debug\threading-multi\extending.exp
msvc.manifest.dll bin\msvc-7.1\debug\threading-multi\extending.pyd
capture-output bin\test_ext.test\msvc-7.1\debug\threading-multi\test_ext
已复制 1 个文件。
====== BEGIN OUTPUT ======
Trying:
from extending import *
Expecting nothing
ok
Trying:
hi = hello('California')
Expecting nothing
ok
Trying:
hi.greet()
Expecting:
'Hello from California'
ok
Trying:
invite(hi)
Expecting:
'Hello from California! Please come soon!'
ok
Trying:
hi.invite()
Expecting:
'Hello from California! Please come soon!'
ok
Trying:
class wordy(hello):
def greet(self):
return hello.greet(self) + ', where the weather is fine'
Expecting nothing
ok
Trying:
hi2 = wordy('Florida')
Expecting nothing
ok
Trying:
hi2.greet()
Expecting:
'Hello from Florida, where the weather is fine'
ok
Trying:
invite(hi2)
Expecting:
'Hello from Florida! Please come soon!'
ok
1 items had no tests:
test_extending.run
1 items passed all tests:
9 tests in test_extending
9 tests in 2 items.
9 passed and 0 failed.
Test passed.
#############到这里似乎正确无误了,接着就报错了:(######################
EXIT STATUS: 0
====== END OUTPUT ======
**passed** bin\test_ext.test\msvc-7.1\debug\threading-multi\test_ext.test
common.mkdir bin\test_embed.test
common.mkdir bin\test_embed.test\msvc-7.1
common.mkdir bin\test_embed.test\msvc-7.1\debug
common.mkdir bin\test_embed.test\msvc-7.1\debug\threading-multi
msvc.link bin\test_embed.test\msvc-7.1\debug\threading-multi\test_embed.exe
LINK : warning LNK4001: 未指定对象文件;已使用库
LINK : warning LNK4068: 未指定 /MACHINE;默认设置为 X86
LINK : error LNK2001: 无法解析的外部符号 _mainCRTStartup
bin\test_embed.test\msvc-7.1\debug\threading-multi\test_embed.exe : fatal error
LNK1120: 1 个无法解析的外部命令
call "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars3
2.bat" >nul
link /NOLOGO /INCREMENTAL:NO /DEBUG /subsystem:console /out:"bin\test_embed.test
\msvc-7.1\debug\threading-multi\test_embed.exe" /LIBPATH:"C:\Python25\libs" @"b
in\test_embed.test\msvc-7.1\debug\threading-multi\test_embed.exe.rsp"
if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
...failed msvc.link bin\test_embed.test\msvc-7.1\debug\threading-multi\test_embe
d.exe bin\test_embed.test\msvc-7.1\debug\threading-multi\test_embed.pdb...
...removing bin\test_embed.test\msvc-7.1\debug\threading-multi\test_embed.pdb
...skipped <pbin\test_embed.test\msvc-7.1\debug\threading-multi>test_embed.run f
or lack of <pbin\test_embed.test\msvc-7.1\debug\threading-multi>test_embed.exe..
.
...failed updating 2 targets...
...skipped 2 targets...
...updated 18 targets...
然后我到C:\Program Files\boost\boost_1_42\libs\python\example\quickstart下运行test_extending.py报错如下:
Trying:
from extending import *
Expecting nothing
**********************************************************************
File "C:\Program Files\boost\boost_1_42\libs\python\example\quickstart\test_extending.py", line 6, in test_extending
Failed example:
from extending import *
Exception raised:
Traceback (most recent call last):
File "C:\Python25\lib\doctest.py", line 1228, in __run
compileflags, 1) in test.globs
File "<doctest test_extending[0]>", line 1, in <module>
from extending import *
ImportError: DLL load failed: 找不到指定的模块。
Trying:
hi = hello('California')
Expecting nothing
**********************************************************************
File "C:\Program Files\boost\boost_1_42\libs\python\example\quickstart\test_extending.py", line 7, in test_extending
Failed example:
hi = hello('California')
Exception raised:
Traceback (most recent call last):
File "C:\Python25\lib\doctest.py", line 1228, in __run
compileflags, 1) in test.globs
File "<doctest test_extending[1]>", line 1, in <module>
hi = hello('California')
NameError: name 'hello' is not defined
Trying:
hi.greet()
Expecting:
'Hello from California'
**********************************************************************
File "C:\Program Files\boost\boost_1_42\libs\python\example\quickstart\test_extending.py", line 8, in test_extending
Failed example:
hi.greet()
Exception raised:
Traceback (most recent call last):
File "C:\Python25\lib\doctest.py", line 1228, in __run
compileflags, 1) in test.globs
File "<doctest test_extending[2]>", line 1, in <module>
hi.greet()
NameError: name 'hi' is not defined
Trying:
invite(hi)
Expecting:
'Hello from California! Please come soon!'
**********************************************************************
File "C:\Program Files\boost\boost_1_42\libs\python\example\quickstart\test_extending.py", line 10, in test_extending
Failed example:
invite(hi)
Exception raised:
Traceback (most recent call last):
File "C:\Python25\lib\doctest.py", line 1228, in __run
compileflags, 1) in test.globs
File "<doctest test_extending[3]>", line 1, in <module>
invite(hi)
NameError: name 'invite' is not defined
Trying:
hi.invite()
Expecting:
'Hello from California! Please come soon!'
**********************************************************************
File "C:\Program Files\boost\boost_1_42\libs\python\example\quickstart\test_extending.py", line 12, in test_extending
Failed example:
hi.invite()
Exception raised:
Traceback (most recent call last):
File "C:\Python25\lib\doctest.py", line 1228, in __run
compileflags, 1) in test.globs
File "<doctest test_extending[4]>", line 1, in <module>
hi.invite()
NameError: name 'hi' is not defined
Trying:
class wordy(hello):
def greet(self):
return hello.greet(self) + ', where the weather is fine'
Expecting nothing
**********************************************************************
File "C:\Program Files\boost\boost_1_42\libs\python\example\quickstart\test_extending.py", line 15, in test_extending
Failed example:
class wordy(hello):
def greet(self):
return hello.greet(self) + ', where the weather is fine'
Exception raised:
Traceback (most recent call last):
File "C:\Python25\lib\doctest.py", line 1228, in __run
compileflags, 1) in test.globs
File "<doctest test_extending[5]>", line 1, in <module>
class wordy(hello):
NameError: name 'hello' is not defined
Trying:
hi2 = wordy('Florida')
Expecting nothing
**********************************************************************
File "C:\Program Files\boost\boost_1_42\libs\python\example\quickstart\test_extending.py", line 19, in test_extending
Failed example:
hi2 = wordy('Florida')
Exception raised:
Traceback (most recent call last):
File "C:\Python25\lib\doctest.py", line 1228, in __run
compileflags, 1) in test.globs
File "<doctest test_extending[6]>", line 1, in <module>
hi2 = wordy('Florida')
NameError: name 'wordy' is not defined
Trying:
hi2.greet()
Expecting:
'Hello from Florida, where the weather is fine'
**********************************************************************
File "C:\Program Files\boost\boost_1_42\libs\python\example\quickstart\test_extending.py", line 20, in test_extending
Failed example:
hi2.greet()
Exception raised:
Traceback (most recent call last):
File "C:\Python25\lib\doctest.py", line 1228, in __run
compileflags, 1) in test.globs
File "<doctest test_extending[7]>", line 1, in <module>
hi2.greet()
NameError: name 'hi2' is not defined
Trying:
invite(hi2)
Expecting:
'Hello from Florida! Please come soon!'
**********************************************************************
File "C:\Program Files\boost\boost_1_42\libs\python\example\quickstart\test_extending.py", line 22, in test_extending
Failed example:
invite(hi2)
Exception raised:
Traceback (most recent call last):
File "C:\Python25\lib\doctest.py", line 1228, in __run
compileflags, 1) in test.globs
File "<doctest test_extending[8]>", line 1, in <module>
invite(hi2)
NameError: name 'invite' is not defined
1 items had no tests:
test_extending.run
**********************************************************************
1 items had failures:
9 of 9 in test_extending
9 tests in 2 items.
0 passed and 9 failed.
***Test Failed*** 9 failures.
曾尝试把生成的extending.pyd拷贝到C:\Python25\DLLs下,然后import extending报错:
>>> import extending
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import extending
ImportError: DLL load failed: 找不到指定的模块。
哪儿不对呢?请在牛A和牛C之间徘徊的人出来:)