2016-08-30 134 views
1

我嘗試爲64位Windows交叉編譯libplist(https://github.com/libimobiledevice/libplist)並從中創建一個DLL。我在Windows 10(Ubuntu 14.04 bash)上爲Linux子系統下載了mingw-w64並設置了環境變量(CC,CXX,CPP,RANLIB)。我使用./autogen.sh --host=x86_64-w64-mingw32來配置軟件包。然而,它與錯誤退出:Windows交叉編譯Python錯誤

configure:16825: error: 
    Could not link test program to Python. Maybe the main Python library has been 
    installed in some non-standard library path. If so, pass it to configure, 
    via the LDFLAGS environment variable. 
    Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" 
    ============================================================================ 
    ERROR! 
    You probably have to install the development version of the Python package 
    for your distribution. The exact name of this package varies among them. 
    ============================================================================ 

config.log它說:

configure:16813: x86_64-w64-mingw32-gcc -o conftest.exe -g -O2 -I/usr/include/python2.7 -I/usr/include/x86_64-linux-g$ 
In file included from /usr/include/python2.7/Python.h:8:0, 
       from conftest.c:33: 
/usr/include/python2.7/pyconfig.h:78:3: error: #error unknown multiarch location for pyconfig.h 
# error unknown multiarch location for pyconfig.h 
^
In file included from /usr/include/python2.7/pyport.h:4:0, 
       from /usr/include/python2.7/Python.h:58, 
       from conftest.c:33: 
/usr/include/python2.7/pyconfig.h:78:3: error: #error unknown multiarch location for pyconfig.h 
# error unknown multiarch location for pyconfig.h 
^
In file included from /usr/include/python2.7/pymath.h:4:0, 
       from /usr/include/python2.7/Python.h:77, 
       from conftest.c:33: 
/usr/include/python2.7/pyconfig.h:78:3: error: #error unknown multiarch location for pyconfig.h 
# error unknown multiarch location for pyconfig.h 
^
configure:16813: $? = 1 

當我嘗試編譯它爲Linux它不返回這個錯誤,所以我想這是因爲它需要爲Windows x86_64編譯的python庫。我從C:/Python27/include複製了Windows中相應的文件,並嘗試分別爲配置LDFLAGS="-L/path/to/python/include"PKG_CONFIG_PATH=/path/to/python/include設置環境變量。他們都沒有工作。我還注意到,在C:/Python27/include還有一個文件叫pyconfig.h。爲什麼腳本使用Linux上安裝的那個?有沒有辦法強迫它使用另一個?

我的主要目標是從libusbmuxd(https://github.com/libimobiledevice/libusbmuxd)製作一個64位的Windows DLL,但它也需要編譯libplist。我怎麼能解決這個問題?提前感謝您的答覆。

回答

0

你可以試試libimobiledevice-win32。雖然名稱有點令人困惑,但它構建了libimobiledevice的32位和64位Windows版本。

您可以使用Visual Studio編譯libplist,libusbmuxd,libimobildevice和Windows的各種實用程序,從而避免需要進行交叉編譯。

我爲Quamotion工作的公司維護libimobiledevice-win32,我們嘗試保持跟蹤最新的上游更改。

您可以從CI構建中下載預編譯的版本,請參閱包含最新比特的zip文件的https://ci.appveyor.com/project/qmfrederik/imobiledevice-net/build/artifacts