xCover - Code Coverage for C and C++ STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... Synesis Software

Building and Linking to the Libraries

Installing the library

xCover 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 xCover 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. xcover-0.2.1.zip which you should extract (recursively) to a location of your choice, e.g. c:\opensrc\xCover\0.1, or ~/opensrc/xCover/0.1, which will be referred to in the subsequent documentation as <XCONTRACT-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 Visual C++ 9 is in build/vc9.

Hence, to build xCover for Visual C++ 9 you need open a Windows command box (with the environment set up for the compiler and linker) and execute the following command:

  <XCONTRACT-install-dir>\build\vc9> make -f makefile

or just:

  <XCONTRACT-install-dir>\build\vc9> make

Note:
For compilers that are supported on more than one platform, the makefiles are located in different sub-directories. For example, for GNU C/C++ v4.3, which is supported for both UNIX and Windows (32-bit), the makefiles are located in <XCONTRACT-install-dir>/build/gcc43.unix and <XCONTRACT-install-dir>/build/gcc43.win32, respectively.

With the Visual C++ 8 project files

Also included are Visual C++ 8 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 xcover.vc8.sln, located in the root directory (i.e. <XCONTRACT-install-dir>), and select the Build-All option.

Note:
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

xCover Library documentation © Matthew Wilson and Synesis Software Pty Ltd, 2008-2009 SourceForge.net Logo