gpt4 book ai didi

python - Windows Python 错误的交叉编译

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:23:31 26 4
gpt4 key购买 nike

我尝试为 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 复制了适当的文件,并尝试为配置 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。我该如何解决这个问题?提前感谢您的回答。

最佳答案

您可以试试 libimobiledevice-win32。尽管名称有点困惑,但它构建了 32 位和 64 位 Windows 版本的 libimobiledevice。

您可以使用 Visual Studio 为 Windows 编译 libplist、libusbmuxd、libimobildevice 和各种实用程序,避免交叉编译。

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

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

关于python - Windows Python 错误的交叉编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39225184/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com