on bbailey@raytheon.com wrote:
> This is a multipart message in MIME format.
> --=_alternative 004E173186257152_=
> Content-Type: text/plain; charset="US-ASCII"
>
> Hello All,
>
> I am currently working to re-work a C app with a Tcl/Tk UI. It had been
> built on Tcl/Tk 8.0 and I intend to use 8.4.12. My problem comes when I
> attempt to execute the compiled C app. When built and run under 8.0, it
> works fine. However, I get an error in the function Tcl_Init when built
> and run under 8.4.12.
>
> For 8.4.12:
>
> int main(void) {
>
> Tcl_Interp *interp;
>
>
> interp = Tcl_CreateInterp();
>
>
> if (Tcl_Init(interp) == TCL_ERROR) {
> printf("Error initing Tcl");
> return TCL_ERROR;
> }
I'd do something like this:
int main (int argc, char *argv[]) {
Tcl_Interp *interp;
/*
* This finds Tcl's library files and performs some initialization.
*/
Tcl_FindExecutable (argv[0]);
interp = Tcl_CreateInterp ();
if (TCL_OK != Tcl_Init (interp)) {
fprintf (stderr, "Tcl_Init error: %s\n", Tcl_GetStringResult
(interp));
exit (EXIT_FAILURE);
}
That's taken from some C code I wrote for this wiki page:
http://mini.net/tcl/Extending%20Tcl
-George
Received on Sun Apr 30 03:14:04 2006