【问题标题】:How to use mingw32 when cross compiling a distutils package?交叉编译 distutils 包时如何使用 mingw32?
【发布时间】:2014-12-29 21:31:58
【问题描述】:

我正在开发 linux python 应用程序,但是它们过于打包,无法部署在 windows 环境中。

我以前从 linux 开发平台做任何事情。

目前,我需要为 win32 交叉编译 python chaco 库。

我需要提供 mingw32 编译器和位于 ~/.wine/drive_c/...中的 python dll 作为参数。

我在使用 mingw32 时遇到了一些问题。 在环境中,我已经在wine驱动中设置了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

【问题讨论】:

    标签: python linux mingw32 chaco


    【解决方案1】:

    从你的 linux 命令行,编译命令类似于:

    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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-01-05
      • 1970-01-01
      • 2011-03-13
      • 2017-11-13
      • 2015-07-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多