2011-03-22 43 views
0

鏈接Boost.Python的我已經通過的MinGW,建立了LIB Boost.Python的LIB 2檔:不能使用MinGW

  • libboost_python-mgw45-MT-1_46_1.a
  • libboost_python-mgw45,MT- d-1_46_1.a

但我不能鏈接這些庫在我的測試程序。和其他組件如正則表達式工作正常。我不知道如何解決這個問題。

我的用戶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的

我的環境:

  • 蟒蛇2.7
  • mingw 4.5.1
  • boost 1.46.1
  • 操作系統:windows xp

希望我解釋清楚我的問題,我不是英語母語的人。 任何建議將不勝感激。

回答

2

我不知道爲什麼(我從來沒有真正關心過挖掘原因),但Boost.Python拒絕在Windows上靜態鏈接。但這很容易解決 - 只需將其重建爲DLL(bjam toolset=gcc --with-python link=shared)。

+0

It works.Thank.I have been tortured by this for several hours ... – ShirenY 2011-03-22 16:54:16