Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

Building and Linking to the Libraries

Installing the library

xTests comes as a source-only distribution, meaning that you will need to build the library before you can use it. The library depends one other open source project: STLSoft. If you wish to build xTests using the makefiles supplied, you will need to have defined the STLSOFT environment variable to be the root directory of the STLSoft include files. (See the STLSoft distribution for more details.) Because STLSoft is 100% header-only, there are no further steps required.

The distribution is in the form of a zip file, e.g. which you should extract (recursively) to a location of your choice, e.g. c:\opensrc\xTests\1.0, or ~/opensrc/xTests/1.0, which will be referred to in the subsequent documentation as <XTESTS-install-dir>.

Building the library for your compiler(s)

Via makefile

Makefiles for all the main supported compilers are included in the subdirectories of the build directory. For example, the makefile for Borland C/C++ v5.6 is in build/bc56. Since Borland is only supported on Windows, there is a single makefile called makefile.

Hence, to build xTests for Borland C/C++ 5.6 you need open a Windows command box (with the environment set up for the compiler and linker) and execute the following command:

  <XTESTS-install-dir>\build\bc56> make -f makefile

or just:

  <XTESTS-install-dir>\build\bc56> make

For compilers that are supported on more than one platform, there are several makefiles located in the build sub-directory. For example, for GNU C/C++ v3.4 (in <XTESTS-install-dir>/build/gcc34) both makefile.unix and makefile.win32 are provided. Most make tools require that you explicitly specify the makefile name (using -f) to use such makefiles, e.g. make -f makefile.unix.

With the Visual C++ 6.0 project files

Also included are Visual C++ 6.0 project files for the libraries and example and test programs. These files can be read (and converted) by any later version of Visual C++.

Just open the workspace file xtests.vc6.dsw, located in the root directory (i.e. <XTESTS-install-dir>), and select the Build-All option.

You need to have the STLSOFT environment variable set up correctly.

Linking the library

There are two options for linking to the core library: explicit linking and implicit linking.

Explicit Linking

Explicit linking requires that you stipulate the requisite library name (and associated path) to your compiler/linker.

For example,

to be completed

Optional Implicit Linking

to be completed

xTests Library documentation Matthew Wilson and Synesis Software Pty Ltd, 1999-2009 Logo