==========================================================================================
More details on the problem:
1 int Qw_Init(Tcl_Interp* Interpreter) {
2 const char* TclInitStubsResult=Tcl_InitStubs(Interpreter,TCL_VERSION,0);
3 cout<<"Qw_Init,1000.0,Tcl_InitStubs,result=="<<TclInitStubsResult<<endl;
4 if (TclInitStubsResult==0) {
5 return TCL_ERROR;
6 }
7 cout<<"Qw_Init,1000.1,"<<endl;
8 char* Buffer=(char*)malloc(100);
9 cout<<"rwb1_debug,Qw_Init,1000.0.3.3"<<endl;
10 ::strcpy(Buffer,"Hello World");
11 cout<<"Qw_Init,1000.2"<<endl;
12 cout<<"Qw_Init,buffer length=="<<::strlen(Buffer)<<endl;
13 cout<<"Qw_Init,1000.3"<<endl;
14 cout<<"QW_init,::argv=="<<Tcl_GetVar(Interpreter,"::argv",TCL_GLOBAL_ONLY)<<endl;
15 ...
The code above is the init function for qw.dll. The package name is qw. The function executes up to line 13 and then silently exists the process when calling Tcl_GetVar in line 13. The correct version is returned from Tcl_InitStubs abnd sent to standard out.
I added lines 8 t0 12 to prove we are successfully calling the c runtime library api as malloc(), strcpy(), strlen() and std::cout all execute and send to stdout as expected. Other output is send to stdout from main.tcl using the puts command, proving that the interpreter is running.
The last thing that comes out in stdout is "Qw_Init,1000.3".
Any tcl (or tk) api function exist silently. So does anyone know why we are not linking properly to the Tcl api stub functions? That is the question. Note that the same coed linked properly in 23-bit.
Ronald Benn