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用来配置包。但是它退出并出现错误:

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 库。我从 Windows 复制了适当的文件,并C:/Python27/include尝试分别设置环境变量以进行配置。他们都没有工作。我还注意到,其中还有一个名为. 为什么脚本使用安装在 Linux 上的文件?有没有办法强迫它使用另一个?LDFLAGS="-L/path/to/python/include"PKG_CONFIG_PATH=/path/to/python/includeC:/Python27/includepyconfig.h

我的主要目标是从 libusbmuxd ( https://github.com/libimobiledevice/libusbmuxd )制作一个 64 位 Windows DLL ,但它也需要编译 libplist。我该如何解决这个问题?感谢您提前回答。

4

1 回答 1

0

你可以试试 libimobiledevice-win32。虽然名称有点混乱,但它构建了 32 位和 64 位 Windows 版本的 libimobiledevice。

您可以使用 Visual Studio 编译 libplist、libusbmuxd、libimobildevice 和各种适用于 Windows 的实用程序,而无需交叉编译。

我工作的公司 Quamotion 维护 libimobiledevice-win32,我们努力跟上最新的上游变化。

您可以从 CI 构建下载预编译版本,请参阅https://ci.appveyor.com/project/qmfrederik/imobiledevice-net/build/artifacts以获取包含最新位的 zip 文件。

于 2018-01-16T11:10:51.007 回答