用Mingw和gcc构建Python [英] Build Python with Mingw and gcc

查看:286
本文介绍了用Mingw和gcc构建Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Windows 7上使用Mingw和gcc从源代码构建Python解释器?
我想推出一个64位版本。



如果有64位Python(gcc Mingw)版本可供下载,请告诉我,我会用那也。
最后我还是想用gcc和mingw来编译它。

首先,你不要需要使用MinGW-w64构建Python以链接到它并嵌入解释器。只需解压缩msi安装程序,并使用预先构建的DLL。请注意,您必须小心,不要混用msvcr [t | 90] .dll对象,但我从未发现这是真正的问题。



MinGW -w64 gcc / ld应该能够直接链接到DLL,否则你必须使用 gendef 创建.def文件 dlltool 创建一个导入库



其次,有一个补丁集可以用MinGW来构建Python ,但我是不确定它的64位兼容性。


Is it possible to build Python interpreter from source with Mingw and gcc on Windows 7? And I would like to biuld a 64bit version.

If a 64bit Python (gcc Mingw) version is available for download please let me know, I would use that also. At the end I still would like to compile it with gcc and mingw.

解决方案

First off, you do not need to build Python with MinGW-w64 to link to it and embed a interpreter. Just extract the msi installer, and use the prebuilt DLL. Note you'll have to be careful not to mix msvcr[t|90].dll objects, but I've never seen that be a real issue personally.

MinGW-w64 gcc/ld should be able to link to DLL's directly, otherwise you'll have to use gendef to create a .def file and dlltool to create an import library.

Secondly, there's a patchset to build Python with MinGW, but I'm not sure about its 64-bit compatibility.

这篇关于用Mingw和gcc构建Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆