不能与MinGW的链接Boost.Python的 [英] Cannot link boost.python with mingw
问题描述
我已经通过的MinGW,建立了LIB Boost.Python的2 LIB文件:
I have already build boost.python lib by mingw,Got two lib files:
- libboost_python-mgw45-MT-1_46_1.a
- libboost_python-mgw45-MT-D-1_46_1.a
但我不能链接这些库在我的测试programs.And其他组件,如正则表达式的作品fine.I不知道如何解决这个问题。
But I cant link these libs in my test programs.And the other components like regex works fine.I dont know how to solve this.
我的用户config.jam中:
my user-config.jam:
using python
: 2.7
: F:\\Programs\\Python\\python # cmd-or-prefix
: F:\\Programs\\Python\\include
: F:\\Programs\\Python\\lib
: <toolset>gcc # condition
;
和构建命令:
的bjam工具集= GCC --with-python的
and the build command: bjam toolset=gcc --with-python
我的环境:
- 蟒蛇2.7
- 的MinGW 4.5.1
- 升压1.46.1
- 操作系统:Windows XP
希望我解释清楚我的问题,我不是英语母语的人。
任何建议将AP preciate。
Hope I explained my problem clearly, I'm not english native speaker. Any advise will be appreciate.
推荐答案
我不知道为什么(我从来没有真正关心不够挖的原因),但Boost.Python的拒绝在Windows静态链接。这是很容易解决的,虽然 - 只是重建它作为一个DLL(的bjam工具集= GCC --with-python的链接=共享
)
I don't know why (and I never really cared enough to dig for the reason), but Boost.Python refuses to link statically on Windows. This is easily solved, though — just rebuild it as a DLL (bjam toolset=gcc --with-python link=shared
).
这篇关于不能与MinGW的链接Boost.Python的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!