问题
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
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.
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
;
and the build command: bjam toolset=gcc --with-python
My Enviroment:
- python 2.7
- mingw 4.5.1
- boost 1.46.1
- OS:windows xp
Hope I explained my problem clearly, I'm not english native speaker. Any advise will be appreciate.
回答1:
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
).
来源:https://stackoverflow.com/questions/5392962/cannot-link-boost-python-with-mingw