From: Michael Tucker <mtucker@ee...> - 2002-08-22 19:16:57
I am having some trouble setting the value of the environment variable
TCL_LIBRARY in a Tcl/Tk app under MacOS 9.1. I have a C/Tcl application
that I built by linking in the Tcl-PPC.lib and Tk-PPC.lib libraries. I
also have a resource file being linked in with STR# resource that should
set the location of my Tcl library. I did this by adding a STR# resource
labelled "Tcl Environment Variables" (without quotes), and then adding an
entry inside of this resource with the string:
tcl_library=Macintosh HD:System Folder:Extensions:Tool Command
I have experimented with upper case (TCL_LIBRARY) and using double-quotes
around the path (and all combinations of the two), but have had no luck. I
also tried using forward-slashes instead of colons, but that no effect.
When I run my application, I get an error message:
Tcl failed: can't find Init resource or a usable Init.tcl file in the
perhaps you need to install Tcl or set your
TCL_LIBRARY environment variable?
I have double-checked, and the folder I specified does exist. It is an
alias to my library directory (though I have also tried replacing the
alias with an actual folder). I'm not sure what else to try... Any ideas?
I am able to move past this stage by making a TEXT resource labelled Init,
putting my Init.tcl file in that, and then adding a line that ``set
tcl_library ...'', but I would prefer to use the STR# if possible.
From: Michael Tucker <mtucker@ee...> - 2002-08-23 17:28:24
In an attempt to circumvent my earlier problem I have been looking at
the source for Wish (from Tcl/Tk 8.3.4) and comparing it to the code that
I am working with. Notably, we make the calls to Tcl_Init and Tk_Init
directly and do not use Tk_Main, but rather Tk_MainLoop. I was considering
adding our C functions to Wish, and compiling that instead, but have run
into a new problem -- I can't get Wish to compile. I imported the XML
TkShells project to Codewarrior Pro 5. I checked the Wiki for any hints on
compiling a PPC version, and then proceeded to build.
I get a number of errors (109 total), but the first one caught my eye:
Error : the file 'MW_TkHeaderPPC' cannot be opened
MW_TkHeader.h line 2 #include "MW_TkHeaderPPC"
Since I don't appear to have a file called MW_TkHeaderPPC on my system,
and google'ing it came up with nothing, I'm not sure what to do. I also
get complaints about X11/Xlib.h and many other problems. Looking into the
Xlib issue, I was surprised to find that the error was coming from the
following code in tk.h:
# ifdef MAC_TCL
# include <Xlib.h>
# include <X.h>
# include <X11/Xlib.h>
Seems to me like MAC_TCL *should* be defined, but I'm concerned that I am
doing something fundamentally wrong, as it would be quite surprising if
there were really this many problems with the build process of a "stable"
release. Any ideas or pointers?