Cannot link boost.python with mingw

做~自己de王妃 提交于 2020-01-07 04:34:10

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!