|
|
我想使用python 的c 导出插件,看介绍boost库很好
编译了一份boost.python release版本的出来,,导出dll改名pyd 然后py里面调用都正常的
可把dll工程换debug版本后再用python_d.exe去执行就报:
ImportError: Module use of python26.dll conflicts with this version of Python.
我靠,都debug版本了,内部还去使用python26.dll ?应该使用python26_d.dll 才对吧?
boost的编译真他NND变态,我用的是这个命令:
bjam.exe --with-python --prefix="d:\boost" python-debugging=on "-sTOOLS=vc-8_0" "variant=debug" "runtime-link=shared" "link=shared" "threading=multi" install
只编译python的debug库
jamroot里面增加了
using python : 2.6 : D:\\Python26-src\\PCbuild\\python_d
: D:\\Python26-src\\Include D:\\Python26-src\\PC
: D:\\Python26-src\\PCbuild
: <python-debugging>on ;
查了N多资料,才知道怎么把debug版本编译出来,可编译出来最后一步给我来了个python26.dll conflicts with this version of Python,这太弱智了吧?
我看到国外一篇帖子跟我遇到的问题相同,估计他也没解决
http://mail.python.org/pipermail/cplusplus-sig/2005-December/009576.html
里面提到,那个人也没搞定:
1) boost_python_debug should be a debug version but it seems to pull in
python24.dll even though python24_d.dll was already loaded.
2) I am getting "ImportError: Module use of python24.dll conflicts with
this version of Python", possibly as a result of (1).
是不是我的那个环节出了问题啊,我可不想用release模式写代码 [em4]
那位过来人帮帮手吧?
如果搞不定,我就打算完全手写导出类和方法的导出dll 到py去用了,那样也很痛苦
PS:我抛开boost库,纯手写dll debug 导出在py里用python_d.exe调用是正常的,所以我很确信是boost.python库的编译问题
|
|