[issue13789] _tkinter does not build on Windows 7

Terry J. Reedy report at bugs.python.org
Sun Jan 15 05:59:16 CET 2012

New submission from Terry J. Reedy <tjreedy at udel.edu>:

Modules/_tkinter.py #includes Modules/tkinter.h, tcl.h, and tk.h. The latter two #include tclDecls.h, tclPlatDecls.h, and tkDecls.h. I obtained 8.5.9 versions of all 5 and added them to Include/. Although they came from Ubuntu, they appear to be cross-platform in that they look for Mac and Win defines. They make the corresponding build errors go away. However, one remains: a failure to open X11/Xlib.h.

This must come from the following in tk.h:
#ifndef RC_INVOKED
#ifndef _XLIB_H
#   if defined(MAC_OSX_TK)
#    include <X11/Xlib.h>
#    include <X11/X.h>
#   else
#    include <X11/Xlib.h>
#   endif
#ifdef __STDC__
#   include <stddef.h>

It seems this tk.h header, at least, expects RC_INVOKED to be defined on non-X11 platforms. Something here is crucially different than on the machine that builds Python for windows. The version of tk.h? the absence of X11/xlib.h? the pcbuild stuff? or the Visual Studio version?

I tried to compile PCbuild/pcbuild.sln with VC2008 Express in the 3.3, 3.2, and 2.7 repositories. For 3.3, I tried both debug and release builds.

components: Build, Windows
messages: 151276
nosy: brian.curtin, loewis, terry.reedy, tim.golden
priority: normal
severity: normal
status: open
title: _tkinter does not build on Windows 7
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list