我嘗試爲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。我怎麼能解決這個問題?提前感謝您的答覆。