X11, Tcl and Tk for Windows

Mark Horn mark.horn@csiro.au
Thu Sep 18 06:37:00 GMT 2003


I am looking for Tcl/Tk v8.0 and a compatible version of Xlib, for a port 
of an application developed originally for a Unix platform. The application 
is a based transport simulator, and is written in C++ . The Tcl/Tk is there 
to provide the GUI, including a window within which X11 calls provide 
"real-time" graphics display of the behaviour of simulated objects (eg 
"real-time" movement of vehicles across a map).

At first sight Cygwin appears to provide what I need:

a. Include files for tcl and tk in usr/include and for X in X11R6/include/X11.
b. The X11 library at usr\X11R6\lib\libX11.a ... And the Tcl/Tk libraries 
tcl80.lib and tk80.lib

But when I link with the libraries mentioned in (b), the following sequence 
of code leads to failure in the X software. For brevity this code omits 
checks on call results, which are OK up to the last line.

   _pint = Tcl_CreateInterp();
   Tcl_Init (_pint);
   _tk_mainwin = Tk_MainWindow (_pint);
   _pdisp= Tk_Display (_tk_mainwin);
   int idc = DefaultColormap (_pdisp, 0); // Failure here, or in subsequent 
call to XParseColor ()

I have also tried linking with libraries tcl84.lib , tk84.lib from the 
Tcl/Tk distribution at http://www.tcl.tk/software/ includes .. but in that 
case I get a failure in the call to Tcl_Init. I would appreciate advice on 
how to obtain a workable collection of the software libraries, or on some 
other way of overcoming these difficulties.

Mark Horn



More information about the Cygwin-xfree mailing list