我尝试为 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/include
C:/Python27/include
pyconfig.h
我的主要目标是从 libusbmuxd ( https://github.com/libimobiledevice/libusbmuxd )制作一个 64 位 Windows DLL ,但它也需要编译 libplist。我该如何解决这个问题?感谢您提前回答。