Similar Threads:
1.bug using TCL command "package require" embedded in C
Hello to all,
I m trying to run serveral TCL commands inside C++ source code and
when I show the information of the auto_path it is empty.
If I put the same command in the tclsh interpreter it runs well.
What Am I doing bad?
in tclsh I insert:
puts $auto_path
puts hola
package require Tk
and runs well.
my c souce code is the next:
#include <tcl.h>
#include <stdlib.h>
int main(int argc, char**argv) {
Tcl_Interp *interp;
int status;
char *comandos[] = { "puts $auto_path","set auto_path /usr/
lib/","puts $auto_path","auto_load","puts hola",
"package require Tk", "package require clock",
, "", NULL };
interp = Tcl_CreateInterp();
if (interp == NULL) {
printf("can not create tcl interpreter\n");
exit(EXIT_FAILURE);
}
int i = 0;
Tcl_Obj *obj;
while (comandos[i] != NULL) {
status = Tcl_Eval(interp, comandos[i]);
if (interp->result[0] != 0) {
printf("%s\n", interp->result);
}
i++;
}
return EXIT_SUCCESS;
}
The result of the execution is:
can't read "auto_path": no such variable
/usr/lib/
/usr/lib/
invalid command name "auto_load"
hola
can't find package Tk
can't find package clock
can't find package AglClient
2.Finding Expect package using Embedded TCL in C++ Application
Hi,
I'm trying to run an expect script from a C++ application that is
embedding TCL in it. I am only running a few TCL commands at this
point. The code looks somewhat like this:
Tcl_FindExecutable("myApp.exe");
myInterpreter = Tcl_CreateInterp();
ret = Tcl_EvalFile(myInterpreter,scriptpath);
This code passes if I use simple TCL commands in my script like puts.
I can load external module as well, however, one particular script I'm
trying to run includes the following line at the top.
package require Expect
Running this, I get the result "can't find package Expect" from
Tcl_GetStringResult(myInterpreter)...
I'm wondering if maybe I need to run some kind of initialization
function. I thought maybe I have some path errors when I launch my
Interpreter that are not resolved when I try to load the Expect
Package.
Any ideas?
Jonathan
3.package require tcldotnet or package require tclmono
I'm just wondering how difficult it would be to implement a package
that would allow the use of dotnet or mono.
package require tcldotnet
or
package require tclmono
4.Packaging Tcl/Tk Application on Windows: Single File Executable
Hi all,
I need to package application developed in Tcl/Tk on Windows. It should
be a single file executable with all data files (gifs), dependency
packages such as winico bundled into a single executable.
There should be not reference to external data files such as images ..
All should be bundled as a single file on desktop.
I have used mktclapp and also freewrap but one needs to keep the image
files separate.
Do I have to change code to include the image files data ?
Thanks in advance,
Andy
5.Zip file/Zip Executable vs StarKit/StarPacks [Was: Tcl application deployment
6. Package require in tcl 8.5.1
7. unnecessary package require in msgcat.tcl
8. [TCL] Strange behavior, or so I think, for package require