2016-08-30 135 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