Just a total wild guess, is this a c++ or a c program? You show a file type of .cpp,
and I thought the compiler would generate different code depending on the
file type of .c vs. .cpp.
bbailey@raytheon.com wrote:
>
> Hello All,
>
> I am currently working to re-work a C app with a Tcl/Tk UI. It had been built on Tcl/Tk 8.0 and I intend to use 8.4.12. My
> problem comes when I attempt to execute the compiled C app. When built and run under 8.0, it works fine. However, I get an error
> in the function Tcl_Init when built and run under 8.4.12.
>
> I use the standard Windows Tcl/Tk install programs in both cases. In order to isolate the problem, I stripped all the code but
> the init routines and supplied a simple script to invoke. I compile the code as follows (MS VS 2003):
>
> For 8.4.12:
>
> cl test.cpp /Ic:\win32app\tcl\include libc.lib kernel32.lib user32.lib wsock32.lib advapi32.lib mpr.lib winspool.lib netapi32.lib
> c:\win32app\tcl\lib\tk84.lib c:\win32app\tcl\lib\tcl84.lib /NODEFAULTLIB:library
>
> For 8.0:
>
> cl test.cpp /Ic:\win32app\tcl\include libc.lib kernel32.lib user32.lib wsock32.lib advapi32.lib mpr.lib winspool.lib netapi32.lib
> c:\win32app\tcl\lib\tk80vc.lib c:\win32app\tcl\lib\tcl80vc.lib /NODEFAULTLIB:library
>
> The simple code itself:
>
> _______________________________________________
>
> #include <stdio.h>
> #include <tk.h>
> #include <tcl.h>
>
>
> int main(void) {
>
> Tcl_Interp *interp;
>
>
> interp = Tcl_CreateInterp();
>
>
> if (Tcl_Init(interp) == TCL_ERROR) {
> printf("Error initing Tcl");
> return TCL_ERROR;
> }
>
> if ((Tk_Init(interp) == TCL_ERROR)) {
> printf("Error initing Tk");
> return TCL_ERROR;
> }
>
>
> if (Tcl_EvalFile (interp, "c:\\ben\\test\\test\\test.tcl"))
> {
> fprintf(stderr, "Error in script (%s):%s\n", "c:\\ben\\test\\test\\test.tcl", interp->result);
> return(1);
> }
>
>
> /* Invoke the Tk objects */
> Tk_MainLoop();
> Tcl_DeleteInterp(interp);
> return TCL_OK;
> }
>
> ________________________________________________________
>
> Any insight would be greatly appreciated.
>
> Ben
Received on Sun Apr 30 03:13:27 2006