Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOWTO init Tcl on Windows ?

Status
Not open for further replies.

Rainer2

Programmer
Jun 13, 2002
2
DE
Hi,

I have extendet my project (Process Visualisation)
with VTK (Visualization Toolkit)
It all works fine under Linux.
But on Windows I can't initialize the Tcl interpreter.
Wish83 is running also VTK !!!
Versions: VTK 4.0 from User's Guide CD including Tcl/Tk 8.3
WindowsXP
VC++ 6.0

What's the problem ? I couldn't find a FAQ for my problem.
Is it a problem of tcl83 with WindowsXP ?

Please give me a hint.
-------------
Rainer Lehrig

/////////////////////////////////////////////////////////////////////////////
// The following test program exits with TCL_ERROR, but interp seems to be ok
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "tcl.h"

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
Tcl_Interp *interp;

interp = Tcl_CreateInterp(); // the returned interp looks ok
if(Tcl_Init(interp) == TCL_ERROR)
{
return TCL_ERROR; // here I get an error
}

return 0;
}
 
Additional Information:

The error is ENOENT "No such file or directory"

So what may be missing (wish83 runs) ?
 
I don't know if this will fix it or not, but in recent years you need to call Tcl_FindExecutable() before creating your interpreter. Here's the line of code you'll need:

Code:
Tcl_FindExecutable(argv[0]);

As the documentation for the function says: "The Tcl_FindExecutable procedure computes the full path name of the executable file from which the application was invoked and saves it for Tcl's internal use. The executable's path name is needed for several purposes in Tcl. For example, it is needed on some platforms in the implementation of the load command. It is also returned by the info nameofexecutable command."

You can find out a bit more about this on the Tcl'ers Wiki, Specifically, you might want to start with the page "Building a custom tclsh," - Ken Jones, President
Avia Training and Consulting
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top