簡體   English   中英

交叉編譯Windows Python錯誤

[英]Cross-compiling for Windows Python error

我嘗試為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庫。 我從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。 我怎么能解決這個問題? 感謝您提前的答案。

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

您可以使用Visual Studio編譯libplist,libusbmuxd,libimobildevice和各種Windows實用程序,避免交叉編譯。

我為Quamotion工作的公司維護着libimobiledevice-win32,我們試圖跟上最新的上游變化。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM