gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 03:49:51 25 4
gpt4 key购买 nike

我正在开发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

最佳答案

从您的 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/查科/轮廓/cntr.o

关于python - 交叉编译distutils包时如何使用mingw32?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26710649/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com