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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access violation while using Tcl_EvalFile

Status
Not open for further replies.

JaneAndrews

Programmer
Apr 15, 2005
1
US
Hi all,
I am very new to Tcl programming world.
I am trying to implement a TCL command in C.
Before that I wanted to try out a small experiment given in a book. But I am getting an access violation when I invoke Tcl_EvalFile. If I use Tcl_Eval with same command, then it works just fine. Somebody please help me.

Thanks a lot in advance.

This is the code:

int main()
{
Tcl_Interp *myInterp;
int retCode;
char name[] = "./simple.tcl";

myInterp = Tcl_CreateInterp();

retCode = Tcl_EvalFile(myInterp, name);
if(retCode != TCL_OK)
fprintf(stdout, "Error\n");

getchar();

return 1;
}

contents of simple.c are : puts Hello.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top