Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Access violation with Tcl_EvalFIle

Posted by jane (jane), 19 April 2005
Hi all,
I am not sure whether this is the right place to post this. If this post fits here, please help me. If I this is not the place, please point me to the right place.

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(system error) when I invoke Tcl_EvalFile. If I use Tcl_Eval with same command, then it works just fine. Somebody please hel
p me.
This is on Windows XP platform.

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); // Access Violation
if(retCode != TCL_OK)
fprintf(stdout, "Error\n");

return 1;
}

contents of simple.c are : puts Hello.

- Jane

Posted by admin (Graham Ellis), 20 April 2005
I can't spot anything straight away (but it just might be staring me in the face!).  The best I can suggest is try the examples that we'ver got at http://www.wellho.net/resources/T243.html which are pretty similar; if they work, then you can play "spot the difference" and if not then I can have a further look.  Also - do you have access to a "nix" operating system to test / see if your code works there.   A further thought - which C compiler are you using on the Microsoft system, and were the Tcl libraries compiled under the SAME compiler?  If not, that's a possible compatabilty issue.

Posted by jane (jane), 20 April 2005
Thanks for the reply, Graham. I figured out what the problem was. I called Tcl_FindExecutable before calling Tcl_EvalFile and it works now. Thanks once again for your time



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho