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

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

问题描述

首先,我应该声明当前的开发环境是在 Windows 7 下的 MSYS + mingw-w64 + ActivePython ,并且在正常的一天我主要是 Linux开发人员。我无法获得或编译带有调试符号的Python库版本。



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



使用我的mingw-w64工具链从源代码构建 Python 2.7.3 证明问题太大 - 并且在任何人因为尝试而燃烧我之前:I承认这个环境不被支持,但我想我可以通过一些明智的补丁(黑客)和:

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



我错了......我放弃了posixmodule。 c因为我的变化的影响变得不确定;因人而异。



我曾尝试使用 Visual C ++ 2010 Express 构建,但主要是Linux开发人员 culture-shock 也是今天我很难忍受; Python项目甚至不能成功导入。显然,我需要Visual C ++ 2008,但我已经确信,如果可能的话,我不想走这条路......

我真的很惊讶没有 zip文件提供互联网上某处必需的.dll文件。 ActiveState应该在每次发布ActivePython时都提供这些内容作为可选下载 - 也许这就是付费支持的来源; - )。

是获得我的环境中Python调试库文件的最佳方式吗? 我刚刚构建了CPython 2.7.5在调试模式下使用Visual Studio 2012 Express(免费)。



我通过维基页面记录了这个过程: https://wiki.python.org/moin/VS2012


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.

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.

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'

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

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...

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 ;-).

What is the best way to obtain the Python debug library files given my environment?

解决方案

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

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

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

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