|
||||||||||||||||||||||||||||||||||||||||||||||||||||
InstallationThis page gives a guide to unpacking, building and using the cstring library. Unpackingcstring comes in a zip file, which you should unpack, preserving the directory structure, into a location of your choice. We'll call this root directory the installation directory, and will refer to it as CSTRING_ROOT for the remainder of this discussion. Note: You are advised to create a CSTRING_ROOT environment variable, defined to the installation directory. This allows you to move, or update, cstring when required without requiring changes in software that depends on it. Building the librarycstring comes as a source-only distribution, which means that you have to compile it yourself in order to use it. It requires only a C compiler and standard library headers and libraries, and, on Win32, the Windows headers and libraries. Makefiles are provided for the following compilers, in the given subdirectories:
To build cstring with your compiler, open a shell / command prompt in the given makefile directory, and execute your make command, as in:
Once the compilation and linking has completed, the library can be found in CSTRING_ROOT/lib. The name of the library is formed according to the following pattern: cstring.<MAJOR-VERSION>.<COMPILER-IDENTITY>.<THREADING-IDENTITY>.<DEBUG-IDENTITY>.<LIBRARY-EXTENSION> where the pattern elements are defined as:
Therefore, the libraries built from the commands given above could be:
Using the libraryOnce you have built cstring, you use it by #include-ing the cstring/cstring.h file in your C/C++ source file, and linking to the appropriate library for your compiler. There are two sample programs supplied in the distribution that demonstrate how this is done. Some compilers support implicit linking: whereby a #pragma in a source file inserts a linker record into the object file that the linker reads, meaning that the library file does not need to be explicitly expressed in the link step. The compilers for which cstring supports explicit linking are Borland, Intel (Win32-only), Metrowerks (Win32-only) and Visual C++. To use explicit linking with these compilers, simply #include the cstring/implicit_link.h file in your C/C++ source file. |
Copyright © 1994-2008 Synesis Software Pty Ltd. All rights reserved.