Building the Windows Binaries
To build Tix on Windows, you must have the following:
- Visual C++ 4.0 or later; or Borland C++ 4.5 or later. There
is not yet built-in support for Tix to work with other compilers.
- The sources of Tcl/Tk for Windows.
- The sources of Tix for Windows.
1. Download the Tcl, Tk and Tix sources
You can download latest version of the Tcl7.5/Tk4.1 (with or without
the p1 patch) from
ftp://ftp.sunlabs.com/pub . There are detailed instructions that
comes with these packages about compiling them on Windows. Hopefully
that will give you a good exercise on setting up the environment for
compiling Tcl-based programs on the Windows platforms.
You can then get the Tix source distribution at
ftp://ftp.xpi.com/pub/Tix41b1.zip . This ZIP file contains files
with long file names and must be unzipped by an UNZIP program that
knows long filenames, such as winzip.exe.
You should put the Tcl, Tk and Tix source packages in the same
directory. For example, my directories look like this:
C:\tcl7.5
C:\tk4.1
C:\Tix4.1b1
2. Compile Tcl and Tk
Follow the instructions that come with Tcl and Tk. If you can
compile successfully, you would get the following files:
C:\tcl7.5\win\tcl75.dll
C:\tcl7.5\win\tclsh75.exe
C:\tk4.1\win\tk41.dll
C:\tk4.1\win\wish41.exe
These are the files you need to run Tcl/Tk on Windows.
3. Running Tcl/Tk -- with the correct DLL files
It's a good idea to try out the binaries you made in step 2
before you compile Tix. This may not be a straight-forward task and
you may experience problems with the wrong DLLs being loaded into
wish41.exe. This is quite common if you have already
installed the binary distribution of Tcl/Tk on your machine.
When wish41.exe starts up, it will load in tcl75.dll
and tk41.dll. Windows searches for a DLL file by first
looking at the PATH environment variable. If the DLL cannot
be located in any of the directory in PATH, or if PATH
is empty, Windows will try to find the DLL from various places
(usually the Windows system directory, depending on which version of
Windows you are running).
The most common problem is, if you haven't set the PATH
variable properly, Windows will usually end up loading the
tcl75.dll from the installed Tcl binary distribution (usually
in C:\tcl\bin\tcl75.dll), not the one you just compiled out
of the Tcl source. This may cause subtle problems such as
wish41.exe refusing to start up or crashing in the middle of
execution.
To ensure that the correct DLLs are loaded, you can type the
following in a DOS window:
set PATH=C:\tcl7.5\win;C:\tk4.1\win
set TCL_LIBRARY=C:\tcl7.5\library
set TK_LIBRARY=C:\tk4.1\library
cd C:\tk4.1\win
.\wish41.exe
If there are still problems, or if you are paranoid, remove the Tcl
binary distribution, if any, from your system. This can be done by
running the program unwise.exe that comes with the Tcl binary
distribution.
4. Compile Tix
Change to the Tix4.1b1\Win subdirectory. If you have Borland C++ 4.5
or 5.0, you can edit the first few lines of the file
makefile.bc according to your environment. Then, you can type
make -f makefile.bc in the DOS window.
If you have Visual C++ installed, you can edit the file makefile.vc
and then type nmake -f makefile.vc in the DOS
window. Notice that if you use Visual C++, you must compile Tcl and
Tk with Visual C++.
When make or nmake finish, you should get the
following files:
C:\Tix4.1b1\win\tix41.dll
C:\Tix4.1b1\win\txwish41.exe
5. Trying things out
Keeping in mind the problem of loading the correct DLL files in run
time, it is best to start up your txwish41.exe with the
following commands in the DOS window:
set PATH=C:\tcl7.5\win;C:\tk4.1\win;C:\Tix4.1b1\win
set TCL_LIBRARY=C:\tcl7.5\library
set TK_LIBRARY=C:\tk4.1\library
set TIX_LIBRARY=C:\Tix4.1b1\library
cd C:\Tix4.1b1\win
.\txwish41.exe
When the Tix console comes up, you should be able to execute the Tix
demo program by typing the following into the console:
source ../demos/widget
If you want to load the Tix DLL into wish41.exe, you can
start up wish41.exe by typing these in the DOS window:
set PATH=C:\tcl7.5\win;C:\tk4.1\win;C:\Tix4.1b1\win
set TCL_LIBRARY=C:\tcl7.5\library
set TK_LIBRARY=C:\tk4.1\library
set TIX_LIBRARY=C:\Tix4.1b1\library
cd C:\tk4.1\win
.\wish41.exe
When the TK console comes up, type the following:
load C:/Tix4.1b1/win/tix41.dll Tix
source C:/Tix4.1b1/demos/widget
6. Trouble Shooting
The most common problem is: "I can't get Tix to run at all." Unlike
previous versions of Tix, the current version usually displays
useful information about any errors that it encounters. However, if
txwish41.exe dies without any messages, check the following:
- Did you set the PATH environment variable to include the
directories where the Tcl, Tk and Tix DLLs are?
- Did you set the TIX_LIBRARY, TK_LIBRARY and
TCL_LIBRARY environment variables correctly?
If that still won't work, try copying tcl75.dll,
tk41.dll, tix41.dll and txwish41.exe into the
same directory; cd to that directory, unset the PATH variable by
typing "set PATH=", set the TIX_LIBRARY,
TK_LIBRARY and TCL_LIBRARY variables and then execute
txwish41.exe. This should work for all but the most
degenarate cases.
FAQ's for running Tix on Windows
- How do I set an environment variable.
-
You can set it in your DOS window by typing something like
"set TIX_LIBRARY=C:\Tix4.1b1\win". This will affect that
particular DOS window only. If you want the change to affect
the whole Windows environment (for example, you want launch
txwish41.exe by double-clicking on its icon), you must
put the commands in your AUTOEXEC.BAT file and then
reboot your machine.
- I get an "out of environment space" error from DOS.
-
Edit your CONFIG.SYS file and add the switch
"/E:1024" to the SHELL=COMMAND.COM
line. Reboot. This should give you enough env space.
- My C compiler says "unrecognized file format tk41.lib" or
something like that.
-
You compiled tk41.lib with VC++ and are compiling Tix
with Borland C++, or vice verse. Use the same compiler to
compile all binaries instead.
- I seem to be loading a DLL from a different directory, even
if I have specified the whole path in the
load
command.
-
Windows lied to you. Even if you say explicitly load
C:/Foo/bar.dll in your Tcl script, some versions of Windows
may load C:/Windows/System/bar.dll instead. Perhaps it's
because the latter is a registered DLL. Or, it may load
C:/Taz/bar.dll because C:/Taz is in your
PATH and C:/foo is not. The bottom line is, don't
trust Windows. If you suspect a DLL conflict, try removing or
renaming those that you don't want to be loaded.
- What is the "My computer" directory in the file selection boxes?
-
That's just C:\, but that may change in the future.
Last modified Sep 30 20:43