Subject: Re: Failed to build tcl8.1
From: Thomas Kowatsch <[email-masked]>
To: Cygwin List <[email-masked]>
Date: Thu, 26 Aug 1999 15:47:58 +0200

Earnie Boyd wrote:

> --- Thomas Kowatsch <[email-masked]> wrote:
> -8<-
> > Ok this was obviously the wrong approach linking with -ltcl81 and stub
> > lib together and was the reason for the core to happen. I now can run
> > it ok.
> >
> > But a another little problem occured. There is no console input after
> > I started wish81.exe. When I start the cygwish80.exe coming with
> > b20.1 a console window pops up. I examined code again and found the
> > problem to be in tk8.1/win/winMain.c. There are two entry points in
> > there, one is main() and the other is WinMain(). If main() is called
> > (what is obviously done by cygwin) then before Tk_Main() is called
> > a variable consoleRequired is set to FALSE. If I start wish81.exe in
> > gdb and set this variable to TRUE before call to Tk_Main() a
> > console window pops up. In WinMain() the consoleRequired is TRUE
> > before call to Tk_Main(). My question is now, what to do:
> >
> > 1.) change code in main() for cygwin to set consoleRequired to TRUE
> > 2.) Find a possibility to get WinMain be called (Any advise)
> >
> > Can anybody help me on this?
>
> If you add the -mwindows switch to the link step the WinMain function would be
> called upon startup instead of the main function.

I rechecked the link line, and it has the -mwindows switch:

gcc  -o wish81.exe   -mwindows winMain.o wish.res.o \
         ../../tcl8.1/win/./libtcl81.a libtk81.a \
          -luser32 -lcomdlg32 -lgdi32 -lwinspool
/usr/local/cygnus/cygwin-b20/usr/bin/../lib/gcc-lib/i586-cygwin32/2.95/../../../../i586-cygwin32/bin

/ld: warning: cannot find entry symbol _WinMainCRTStartup; defaulting to 00401000

Rechecked with gdb:

gdb ./wish81.exe
GNU gdb 4.17.1
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-cygwin32"...
(gdb) b main
Breakpoint 1 at 0x401377: file ../win/winMain.c, line 349.
(gdb) b WinMain
Breakpoint 2 at 0x401059: file ../win/winMain.c, line 83.
(gdb) r
Starting program: /tmp/tcl/bin/./wish81.exe
6d500000:/tmp/tcl/bin/tcl81.dll

[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

77e70000:/c/WINNT/system32/USER32.dll
77ed0000:/c/WINNT/system32/GDI32.dll
77e10000:/c/WINNT/system32/RPCRT4.dll
61000000:/usr/local/cygnus/cygwin-b20/usr/bin/cygwin1.dll
642c0000:/tmp/tcl/bin/tk81.dll
77d80000:/c/WINNT/system32/COMDLG32.DLL
77c40000:/c/WINNT/system32/SHELL32.dll
71030000:/c/WINNT/system32/COMCTL32.dll
5f810000:/c/WINNT/System32/rpcltc1.dll

Breakpoint 1, main (argc=1, argv=0xa0310b8) at ../win/winMain.c:349
349         Tcl_SetPanicProc(WishPanic);
(gdb)

Any ideas?

Cheers,
Tommy

--
------------------------------------------------------------------------
Thomas Kowatsch                      | - Senior Software Engineer -
Switching Test Solutions AG          | mailto: [email-masked]
Wavetek Wandel & Goltermann Divison5 | web   : http://www.stest.com
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 [email-masked]