DAtum

EDA, Software and Business of technology
Greek, 'loxos: slanting. To displace or remove from its proper place
da·tums A point, line, or surface used as a reference


                        ... disruption results in new equilibria


Weird TCL behavior on Cygwin/MinGW

A C++ program compiled with TCL stubs, which performs just fine on Linux, just seems to go out without a sound on Cygwin. TCL_LIBRARY was set properly (also tried the
"export TCL_LIBRARY=$(cygpath -w /usr/share/tcl8.4)"
hack). But the execution just seems to vanish after a call to Tcl_Init(). Now internally, Tcl_Init parses a whole load of stuff, starting from init.tcl.
Also tried a weird hack that changes the "tclPreInitScript" variable to help set the $tcl_library variable, et al. But nothing helped.
On debugging the executable in gdb, the call to Tcl_Init returns a segfault, which is not visible on a normal run.
The solution to this mystery is a simple call to
"Tcl_FindExecutable(argv[0])"
, which sets up some internal variables for use by tcl. Now since in cygwin there are two paths (the /usr type path and the /cygdrive/usr path) for all resources, this helps initialise everything correctly. I almost did'nt try this solution.
But it works!!!

del.icio.us Tags:
« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
|