如何为 Windows 获取预构建的 *debug* 版本的 Python 库(例如 Python27_d.dll) [英] How to obtain pre-built *debug* version of Python library (e.g. Python27_d.dll) for Windows

查看:30
本文介绍了如何为 Windows 获取预构建的 *debug* 版本的 Python 库(例如 Python27_d.dll)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我要声明我目前的开发环境是 Windows 7 下的 MSYS + mingw-w64 + ActivePython 并且在平常的日子里我主要是 Linux 开发人员.我不高兴获得或编译带有调试符号的 Python 库版本.

Firstly, I should state that my current development environment is MSYS + mingw-w64 + ActivePython under Windows 7 and that on a normal day I am primarily a Linux developer. I am having no joy obtaining, or compiling, a version of the Python library with debug symbols.

理想情况下,我需要 Python27.dll 文件的 32 位和 64 位调试版本.我希望能够在 C++ 中嵌入 Python 和实现 Python 扩展,并且能够使用我为 mingw-w64 构建的 gdb-7.4 和纯 WingIDE 调用无缝调试工具Python 方面的东西.

I need both 32bit and 64bit debug versions of the Python27.dll file, ideally. I want to be able to embed Python and implement Python extensions in C++, and be able to call upon a seamless debugging facility using the gdb-7.4 I have built for mingw-w64, and WingIDE for the pure Python side of things.

使用我的 mingw-w64 工具链从源代码构建 Python 2.7.3 被证明太成问题了——在有人因为我的尝试而发火之前:我承认这个环境不受支持,但我想我可能会能够通过一些明智的补丁(黑客)来完成这项工作,并且:

Building Python 2.7.3 from source with my mingw-w64 toolchain is proving too problematic -- and before anyone flames me for trying: I acknowledge that this environment is unsupported, but I thought I might be able to get this working with a few judicious patches (hacks) and:

make OPT='-g -DMS_WIN32 -DWIN32 -DNDEBUG -D_WINDOWS -DUSE_DL_EXPORT'

我错了...我放弃了 posixmodule.c,因为我的更改的影响变得不确定;ymmv.

I was wrong... I gave up at posixmodule.c since the impact of my changes became uncertain; ymmv.

我曾尝试使用 Visual C++ 2010 Express 进行构建,但作为一名主要的 Linux 开发人员,culture-shock 让我今天无法承受;Python 项目甚至没有成功导入.显然,我需要 Visual C++ 2008,但我已经确信如果可能的话,我不想走这条路……

I have tried building with Visual C++ 2010 Express but being primarily a Linux developer the culture-shock is too much for me to bear today; the Python project does not even import successfully. Apparently, I need Visual C++ 2008, yet I am already convinced I don't want to go down this road if at all possible...

令我惊讶的是,在 Internet 上的某个地方没有 提供必要 .dll 的 zip 文件.ActiveState 确实应该在他们制作的每个 ActivePython 版本中将这些作为可选下载提供——也许这就是付费支持的来源;-).

It's really surprising to me that there is not a zip-file providing the requisite .dlls somewhere on the Internet. ActiveState should really provide these as an optional download with each release of ActivePython that they make -- perhaps that's where the paid support comes in ;-).

在给定我的环境的情况下,获取 Python 调试库文件的最佳方式是什么?

推荐答案

我刚刚使用 Visual Studio 2012 Express(免费)在调试模式下构建了 CPython 2.7.5.

I've just built CPython 2.7.5 in debug mode with Visual Studio 2012 Express (free).

我通过 wiki 页面记录了该过程:https://wiki.python.org/moin/VS2012

I documented the process via wiki page: https://wiki.python.org/moin/VS2012

这篇关于如何为 Windows 获取预构建的 *debug* 版本的 Python 库(例如 Python27_d.dll)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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