Failed to build tcl8.1

Thomas Kowatsch
Tue Aug 24 09:20:00 GMT 1999

Mumit Khan wrote:

> Thomas Kowatsch <> writes:
> > I just tried to compile tcl8.1 following Mumit's directions but failed.
> >
> > I have dowloaded tcl8.1.1, gcc-2.95, w32api-0.1.5. I have installed the
> > B20.1 release and replaced compiler with gcc-2.95 from Mumit's build.
> > Apllied also Mumit's patch for w32api-0.1.5, maked and installed it into
> My patches are for 8.1, not for 8.1.1, which is quite different in some
> areas (eg., it uses winsock2, not supported (yet) by the w32api headers).
> Regards,
> Mumit

Sorry for picking up this thread again but I still have problems but had
to do something else for the last two weeks.
As Mumit suggested I downloaded 8.1, applied his patches. Tcl build very
fine without problems. But I had problems with building TK. There were
some functions defined locally in modules which have the same name
as prototypes in wingdi.h and winuser.h. These were:

- CreateBitmap() in generic/tkCanvBmap.c
- GetCursor() in generic/tkCursor.c
- SetFocus() in generic/tkFocus.c

I just renamed these function in there modules prepending a Tk. Then
compile worked just fine but when it came to link the dll I got
thousands of unresolved externals from tcl like
  tkWindow.o: In function `Initialize':
undefined reference to `_imp__Tcl_PkgRequire'
undefined reference to `_imp__Tcl_GetThreadData'

I figured out that this was due to the missing -ltcl81 in the buildline
for the libtk81.dll. So I added that and then ... everything compiled
ok. Then I installed everything in a temporary directory and tried to
run it. tclsh81.exe semmed to be ok but when I ran wish81.exe I got
a core. Loaded wish81.exe into gdb and run it. Following the output:

(gdb) r
Starting program: /tmp/tcl/bin/wish81.exe

[failed reading symbols from DLL]
"/c/WINNT/system32/ADVAPI32.DLL": error reading line numbers

[failed reading symbols from DLL]
"/c/WINNT/system32/KERNEL32.dll": error reading line numbers


Program received signal SIGSEGV, Segmentation fault.
0x643450ca in Tk_InitStubs (interp=0x247b178, version=0x64345eca "8.1",
    exact=1) at ./../generic/tkStubLib.c:91
91          actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, exact,
(gdb) bt
#0  0x643450ca in Tk_InitStubs (interp=0x247b178, version=0x64345eca "8.1",
    exact=1) at ./../generic/tkStubLib.c:91
#1  0x643479f0 in Initialize (interp=0x247b178) at
#2  0x64347376 in Tk_Init (interp=0x247b178) at ./../generic/tkWindow.c:2618
#3  0x401104 in Tcl_AppInit ()
#4  0x6431bc51 in Tk_MainEx (argc=1, argv=0xa0310b8,
    appInitProc=0x4010dc <Tcl_AppInit>, interp=0x247b178)
    at ./../generic/tkMain.c:218
#5  0x4013c8 in main ()
#6  0x6100442e in _size_of_stack_reserve__ ()
#7  0x61004517 in _size_of_stack_reserve__ ()
#8  0x40156e in cygwin_crt0 (f=0x401364 <main>)
    at /home/noer/src/b20/comp-tools/devo/winsup/
(gdb) list
86          char *version;
87          int exact;
88      {
89          char *actualVersion;
91          actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, exact,
92                      (ClientData *) &tkStubsPtr);
93          if (!actualVersion) {
94              return NULL;
95          }
(gdb) print interp
$1 = (Tcl_Interp *) 0x247b178
(gdb) print version
$2 = 0x64345eca "8.1"
(gdb) print exact
$3 = 1
(gdb) print tkStubsPtr
$4 = (TkStubs *) 0x0
(gdb) print &tkStubsPtr
$5 = (TkStubs **) 0x64365c70
(gdb) print  Tcl_PkgRequireEx
$6 = {char *(Tcl_Interp *, char *, char *, int,
    ClientData *)} 0x6d54ab8c <Tcl_PkgRequireEx>

Anybody got an idea? The link line of the wish produces following output:

gcc  -o wish81.exe   -mwindows  wish.res.o \
        winMain.o  libtk81.a ../../tcl8.1/win/./libtcl81.a \
          -luser32 -lcomdlg32 -lgdi32 -lwinspool
warning: cannot find entry symbol _WinMainCRTStartup; defaulting to 00401000


Thomas Kowatsch                      | - Senior Software Engineer -
Switching Test Solutions AG          | mailto:
Wavetek Wandel & Goltermann Divison5 | web   :
Friesenbergstr. 75                   | Phone : +41 1 454-6731
CH-8055 Zuerich                      | FAX   : +41 1 454-6612

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list