简体   繁体   中英

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.

I use to do everything from linux development platform.

At the moment, however I need cross compiling python chaco library for win32.

I need to give as arguments, the mingw32 compiler, and the python dll located in ~/.wine/drive_c/...

I have got some problems using it with mingw32. In the environment, I have got python win32 setted up in wine drive.

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 :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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