Mailing List Archive

cygwin32-b20 _tkinter problem
When I try to compile python-1.5.2b2 under WinNT with Cygwin32-B20 it
works very well without Tk-Module. But when I try to include Tk, I get
the following messages:

gcc python.o \
../libpython1.5.a -ltix4180 -ltk80 -ltcl80 -lstdc++ -lm
-lm -o python
../libpython1.5.a(_tkinter.o): In function `Tkapp_CreateFileHandler':
//c/temp/Python-1.5.2b2/Modules/./_tkinter.c:1459: undefined
reference to `Tcl_CreateFileHandler'
../libpython1.5.a(_tkinter.o): In function `Tkapp_DeleteFileHandler':
//c/temp/Python-1.5.2b2/Modules/./_tkinter.c:1486: undefined
reference to `Tcl_DeleteFileHandler'
../libpython1.5.a(_tkinter.o): In function `EventHook':
//c/temp/Python-1.5.2b2/Modules/./_tkinter.c:1913: undefined
reference to `Tcl_CreateFileHandler'
//c/temp/Python-1.5.2b2/Modules/./_tkinter.c:1943: undefined
reference to `Tcl_DeleteFileHandler'
collect2: ld returned 1 exit status
make[1]: *** [link] Error 1
make: *** [python] Error 2

My Modules/Setup looks like this

# *** Always uncomment this (leave the leading underscore in!):
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
# -I/usr/local/include \
# *** Uncomment and edit to reflect where your X11 header files are:
# -I/usr/X11R6/include \
# *** Or uncomment this for Solaris:
# -I/usr/openwin/include \
# *** Uncomment and edit for Tix extension only:
-DWITH_TIX -ltix4180 \
# *** Uncomment and edit for BLT extension only:
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
# *** Uncomment and edit for PIL (TkImaging) extension only:
# -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \
# *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
# -L/usr/local/lib \
# *** Uncomment and edit to reflect your Tcl/Tk versions:
-ltk80 -ltcl80 \
# *** Uncomment and edit to reflect where your X11 libraries are:
# -L/usr/X11R6/lib \
# *** Or uncomment this for Solaris:
# -L/usr/openwin/lib \
# *** Uncomment these for TOGL extension only:
# -lGL -lGLU -lXext -lXmu \
# *** Uncomment for AIX:
# -lld \
# *** Always uncomment this; X11 libraries to link with:
# -lX11
-lstdc++

Tcl/Tk header and libs are in the Cygwin32-directories and the
compiler finds them.

Since I have no idea, what is the equivalent of X11 under Cygwin, I
used libstdc++. Is this the problem ?
cygwin32-b20 _tkinter problem [ In reply to ]
Monika Göhmann wrote:
>
> When I try to compile python-1.5.2b2 under WinNT with Cygwin32-B20 it
> works very well without Tk-Module. But when I try to include Tk, I get
> the following messages:
>
> gcc python.o \
> ../libpython1.5.a -ltix4180 -ltk80 -ltcl80 -lstdc++ -lm
> -lm -o python
> ../libpython1.5.a(_tkinter.o): In function `Tkapp_CreateFileHandler':
> //c/temp/Python-1.5.2b2/Modules/./_tkinter.c:1459: undefined
> reference to `Tcl_CreateFileHandler'
> ../libpython1.5.a(_tkinter.o): In function `Tkapp_DeleteFileHandler':
> //c/temp/Python-1.5.2b2/Modules/./_tkinter.c:1486: undefined
> reference to `Tcl_DeleteFileHandler'
> ../libpython1.5.a(_tkinter.o): In function `EventHook':
> //c/temp/Python-1.5.2b2/Modules/./_tkinter.c:1913: undefined
> reference to `Tcl_CreateFileHandler'
> //c/temp/Python-1.5.2b2/Modules/./_tkinter.c:1943: undefined
> reference to `Tcl_DeleteFileHandler'
> collect2: ld returned 1 exit status
> make[1]: *** [link] Error 1
> make: *** [python] Error 2

Add -lexpect526 to the command line. Those symbols are only defined in
libexpect526.a of the cygwin B20.1 distribution.

Hope that helps.

[snip]

--
Robert Kern |
----------------------|"In the fields of Hell where the grass grows high
This space | Are the graves of dreams allowed to die."
intentionally | - Richard Harter
left blank. |
cygwin32-b20 _tkinter problem [ In reply to ]
On Sun, 11 Apr 1999 19:32:31 -0400, Robert Kern
<kernr@mail.ncifcrf.gov> wrote:


>Add -lexpect526 to the command line. Those symbols are only defined in
>libexpect526.a of the cygwin B20.1 distribution.
>
>Hope that helps.
>
>[snip]
>
>--
>Robert Kern |

Well yes, I did but got a myriad of error messages. I now do believe,
you need to comment out a few lines in _tkinter.c.

//#if TKMAJORMINOR < 8000 || !defined(MS_WINDOWS)
//#define HAVE_CREATEFILEHANDLER
//#endif

Cygwin does not define MS_WINDOWS, since it is kind of a "UNIX"
system. Nevertheless the two functions which were giving me the error
are not included ( other than in the expect526.a which does not work )

With this change _tkinter.c does compile and link fine and IDLE, for
example is running. I still do have lot's of problems with PATH
settings, but that's another story.

Thanks for your help, Monika Göhmann