游戏开发论坛

 找回密码
 立即注册
搜索
查看: 3186|回复: 3

求助boost.python的编译问题

[复制链接]

119

主题

1367

帖子

1393

积分

金牌会员

Rank: 6Rank: 6

积分
1393
发表于 2009-7-26 16:00:00 | 显示全部楼层 |阅读模式
我想使用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库的编译问题




119

主题

1367

帖子

1393

积分

金牌会员

Rank: 6Rank: 6

积分
1393
 楼主| 发表于 2009-7-26 17:57:00 | 显示全部楼层

Re:求助boost.python的编译问题

终于搞定了,弄了一下午bjam编译个东东真的有点麻烦

15

主题

368

帖子

406

积分

中级会员

Rank: 3Rank: 3

积分
406
发表于 2009-7-26 18:06:00 | 显示全部楼层

Re:求助boost.python的编译问题

等boost集成进C++标准里就会方便许多的。目前VC2008 SP1已经集成了一部分boost的东西了。auto_ptr,regex等比较实用的东西都可以直接用了。不过python库还没集成。

119

主题

1367

帖子

1393

积分

金牌会员

Rank: 6Rank: 6

积分
1393
 楼主| 发表于 2009-7-26 18:34:00 | 显示全部楼层

Re:求助boost.python的编译问题

boost太庞大了,真搞不懂这是多少人写出来的东西啊?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-12-20 16:45

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表