Installing and Building e4Graph on Win32
Author: Jacob Levy

Installing and Building e4Graph on Win32 Systems

This page explains how to install and use the prebuilt distributions for Win32 systems, and how to build e4Graph from source on Win32 systems.

Using the Prebuilt Distribution on Win32 Systems

The prebuilt distributions have the following directory structure:

- The top-level directory contains the files README, INSTALL, readme.html and changes. The name of this directory reflects the version of e4Graph which this release represents; e.g. e4graph-1.2b3 is the third Beta of release 1.2.
- include contains header files for all sub-packages provided by e4Graph.
- docs contains documentation for all sub-packages provided by e4Graph, including this document.
- lib contains dynamic load libraries.
- exp contains export libraries.

The e4Graph DLL files were compiled in release mode with Visual C++ 6.0. If you intend to To use this pre-built distribution of e4Graph in another project that you build from source, you need to have Visual C++ 6.0 installed on your system. If you intend to use the Tcl or Python binding, you only need to do the first step in the list below. If you want to use e4Graph from Java, do the first two steps in the list below. To use e4Graph in a project that you will build from source, do the following:

- You must have pre-installed binary distributions of Metakit 2.4.9.2 and optionally Tcl 8.4, Python 2.2.3, Expat 1.95.7 or later, and Java Runtime Environment 1.4.1. See here for how to obtain them.
- Copy lib\e4graph.dll, lib\tgraph.dll, lib\e4xml.dll, lib\e4py.dll, lib\txml.dll, and lib\e4java.dll into a directory in your PATH variable.
- If you intend to use the Tcl binding, copy lib\pkgIndex.tcl into a directory in Tcl's auto_path
- If you intend to use the Java binding, add lib\e4java.jar to your CLASSPATH.
- Add the include directory to the include path of your project and include e4graph.h in the source files of your project that need direct access to e4Graph types and methods. If your project uses the Tcl binding, include t4graph.h instead; it recursively includes all the other needed files. If your project uses the Python binding, include e4py.h instead; it recursively includes all the other needed files. If you intend to use the XML facilities, you can include e4xml.h; it recursively includes e4graph.h and all other needed files. If you intend to use both the XML facilities and the Tcl binding, include t4xml.h.
- Add the exp directory to the input directories for linking your project and add e4graph.lib to the libraries to be linked with your project. This will guarantee that the executable or DLL built by your project will load the e4Graph DLL when it is used or executed. If you use the Tcl binding, add tgraph.lib instead; it depends on e4graph.lib and will recursively include it. If you use the Python binding, add e4py.lib instead; it depends on e4graph.lib and will recursively include it. If your project uses the XML facilities, add e4xml.lib instead; it depends on e4graph.lib and will recursively include it. If your project uses both the Tcl binding and XML, add t4xml.lib instead; it depends on both tgraph.lib and e4xml.lib and will recursively include them.

Building e4Graph from Source and Using it

Assume that e4Graph sources are in c:\e4graph-1.0a11. The e4Graph source distribution expects to find the source distribution of Metakit 2.4.9.2 in c:\metakit-2.4.9.2. Optionally, it expects to find the Tcl 8.4 binary distribution for Win32 systems in c:\tcl8.4, the Python binary distribution in c:\python-2.2.3, and the Expat distribution in c:\expat-1.95.7. If you're building the Java binding, the J2SDK 1.4.1 should be in c:\j2sdk1.4.1_01.

The source distribution is configured this way because I expect that most developers wanting to use e4Graph also build Metakit from source. However, often it is OK to use binary distributions for Tcl and Expat, and for Java only binary distributions are available.

Before building e4Graph, you need to build Metakit with Visual C++ 6.0, which must be installed on your system. Build the mksrc project. If you want to build the XML related facilities, the source code for Expat must be installed in c:\expat-1.95.7. You should build expat prior to using it in a build of e4Graph.

First build Metakit, and optionally Expat, from their sources. Then open the e4Graph workspace c:\e4graph-1.0a11\all\all.dsw in Visual C++ 6.0 and select from the following sub-projects of e4Graph (you should use the release configuration for optimal performance and you can use the debug configuration if you want to use the debugger to step into e4Graph sources):

NOTE: Please use the e4graph\all\win32\vc60\all.dsw C++ workspace to build all targets, and do not use individual project files found in each subdirectory. This will ensure that your build gets passed global parameters that are common to all projects, such as where to find the Metakit libraries needed to link, etc. If you use individual project files directly, you may get incorrect or obsolete settings for these parameters. I'm investigating how to fix this so that you get the right parameters even when you use individual project files, but it's not a very high priority task compared to other problems that must be solved, so I cannot promise to fix this.

- all builds everything below, except the Java binding which is currently considered experimental. As distributed, the project file is set to build all in release configuration.
- main builds just the e4Graph DLL, e4graph.dll. This depends on Metakit 2.4.9.2 being installed as explained above.
- teste4dll builds the exhaustive test binary teste4dll.exe which exercises all facilities of the base e4Graph library.
- teste4lib builds the exhaustive test binary teste4lib.exe which is a statically linked version of teste4dll.exe.
- tcl builds main and then the Tcl binding DLL, tgraph.dll. This depends on Metakit 2.4.9.2 and Tcl 8.4 being installed.
- python builds main and then the Python binding DLL, e4py.dll. This depends on Metakit 2.4.9.2 and Python 2.2.3 being installed.
- xml builds main and then the XML facilities DLL, e4xml.dll. This depends on Metakit 2.4.9.2 and Expat 1.95.7 being installed as explained above.
- t4xml builds main, tcl and xml, and then the XML facilities for Tcl, embodied in txml.dll. This depends on Metakit 2.4.9.2, Expat 1.95.7 and Tcl 8.4 being installed.
- java builds main and then the Java binding for e4Graph, embodied in e4java.dll. This depends on Metakit 2.4.9.2 and J2SDK 1.4.0_01 being installed.

The products of these build targets are left in c:\e4graph-1.0a11\builds\win32\.

To learn how to use the e4Graph sub-packages you just built in your own projects, read this section, treating c:\e4graph-1.0a11\builds\win32\ as the root directory of a prebuilt distribution.