title: ERROR in script: can't find package Tk 8.4 (c wrapped tcl)
body: <p>I've encountered the above mentioned error while I was trying to run a Tcl script embedded in C code:</p>
  
  <pre><code>Tcl_FindExecutable(argv[0]);
  interp = Tcl_CreateInterp();
  code = Tcl_Eval(interp, "source mainTCL.tcl");
  
  /* Retrieve the result... */
  result = Tcl_GetString(Tcl_GetObjResult(interp));
  
  /* Check for error! If an error, message is result. */
  if (code == TCL_ERROR) {
      fprintf(stderr, "ERROR in script: %s\n", result);
      exit(1);
  }
  </code></pre>
  
  <p>As suggested here: <a href="https://stackoverflow.com/questions/13853770/how-to-use-tcl-apis-in-a-c-code">how-to-use-tcl-apis-in-a-c-code</a>.</p>
  
  <p>When running this script from tclsh there is no error. I also tried setting <code>$auto_path</code> but it is not working.
  I traced where error is happening by adding <code>puts</code> and it is here:</p>
  
  <pre><code>source "/usr/share/tcltk/tkcon2.7/tkcon.tcl"
  </code></pre>
  
  <p>What is the problem? Any help is appreciated... What is the difference between tclsh and C instance of Tcl interpreter?</p>