2017-07-12 45 views
1

構建的python我試圖從C++和boost源碼構建BGSLibrary python模塊。該庫在linux上編譯時沒有問題。對於Windows,我使用Visual Studio 2017和Cmake 3.9。這是我的步驟。加載自定義DLL中的依賴錯誤使用Visual Studio 2017和增強

  1. 的Visual Studio安裝選項 image

  2. 下載加速,從Visual Studio命令內安裝腳本線路終端

    bootstrap.bat

    b2 -j%cores% toolset=msvc-14.1 address-model=32 architecture=x86 link=static threading=multi runtime-link=static --build-type=complete stage --with-python

  3. 將boost_python-vc141-mt-s-1_64.lib重命名爲python_boost.lib以滿足cmake需求。
  • CMake的配置選項 image

  • 的Visual Studio外置包含目錄 image

  • Visual Studio的外部lib目錄 image

  • 將原先命名boost_python-副本vc141-mt-s-1_64.lib添加到bgs build文件夾。

  • 執行Visual Studio Build。它成功創建libbgs python dll enter image description here

  • 根據此question我將libbgs.dll重命名爲.pyd並在文件夾中有boost lib。我將bgslibrary/build添加到路徑。不幸的是還沒有完成。

  • image

    一些依賴問題。快速瀏覽DependencyWalker是非常令人生畏的,有很多問題。

    enter image description here

    之前,我去嘗試單獨添加所有這些.dll文件手動到bgslibrary/build文件夾,是沒有辦法,我已經做了一個更高的水平誤差。我是否應該在Visual Studio的一般屬性中選擇「靜態庫」,是否會有所作爲?

    回答

    0

    已解決。依賴性步行者已經足夠陳舊,只是顯示了很多錯誤。真的,它只是4個opencv dll。將opencv/build/release/bin添加到我的路徑中。

    相關問題