简体   繁体   English

交叉编译distutils包时如何使用mingw32?

[英]How to use mingw32 when cross compiling a distutils package?

I am developing linux python applications, but they are too packaged to be deployed in windows environment. 我正在开发linux python应用程序,但是它们打包得太小了,无法在Windows环境中部署。

I use to do everything from linux development platform. 我使用Linux开发平台来做所有事情。

At the moment, however I need cross compiling python chaco library for win32. 目前,但是我需要为win32交叉编译python chaco库。

I need to give as arguments, the mingw32 compiler, and the python dll located in ~/.wine/drive_c/... 我需要给出mingw32编译器和〜/ .wine / drive_c /中的python dll作为参数。

I have got some problems using it with mingw32. 我在mingw32上使用它时遇到了一些问题。 In the environment, I have got python win32 setted up in wine drive. 在环境中,我在wine drive中设置了python win32。

python setup.py  build --compiler=mingw32
running build
running build_py
running egg_info
writing requirements to Chaco.egg-info/requires.txt
writing Chaco.egg-info/PKG-INFO
writing namespace_packages to Chaco.egg-info/namespace_packages.txt
writing top-level names to Chaco.egg-info/top_level.txt
writing dependency_links to Chaco.egg-info/dependency_links.txt
writing manifest file 'Chaco.egg-info/SOURCES.txt'
running build_ext
building 'enthought.chaco.contour.contour' extension
gcc -mno-cygwin -mdll -O -Wall -DNUMPY -I/usr/lib/python2.6/dist-packages/numpy/core/include -I/usr/include/python2.6 -c enthought/chaco/contour/cntr.c -o build/temp.linux-x86_64-2.6/enthought/chaco/contour/cntr.o
cc1: error: unrecognized command line option "-mno-cygwin"
cc1: error: unrecognized command line option "-mdll"
error: command 'gcc' failed with exit status 1

from your linux cmdline , the command to compile would be similar to : 在您的Linux cmdline中,编译命令类似于:

i586-mingw32msvc-gcc -mdll -O -Wall -DNUMPY -I/home/xxx/.wine/drive_c/Python26/include -I/home/xxxx/.wine/drive_c/Python26/Lib/site-packages/numpy/core/include -c enthought/chaco/contour/cntr.c -o build/temp.linux-x86_64-2.6/enthought/chaco/contour/cntr.o i586-mingw32msvc-gcc -mdll -O -Wall -DNUMPY -I / home / xxx / .wine / drive_c / Python26 / include -I / home / xxxx / .wine / drive_c / Python26 / Lib / site-packages / numpy /核心/包括-c enthought / chaco / contour / cntr.c -o build / temp.linux-x86_64-2.6 / enthought / chaco / contour / cntr.o

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM