Compilation Issues

UNIX/BSD/Cygwin Compilation

Compilation of SAFMQ is supported in UNIX and BSD like environments using gmake & gcc versions 3 and 4. Makefiles have been supplied to automatically build all components, unless the system is missing key resources. SAFMQ is dependent on OpenSSL for SSL capabilities and on PHP version 5 for the PHP library. A "configure" script supplied with the distribution will detect the existence of OpenSSL and PHP on the system and tune the make process to build available features. Issuing the configure command with the --help option produces:

$ ./configure --help

Configureation utility usage:

./configure [options]


--help,-h                       : Show this page
--without-ssl                   : Disables SSL integration
--ssl-location=<dir>            : Location of SSL libraries if not in a standard location
--with-custom-getopt            : Force use custom comand line processing
--with-include-dir=<dir>        : Add a directory to the include path, may be repeated
--prefix=<dir>                  : Set the install base, defaults to /usr/local
--bin-prefix=<dir>              : Set the install binary location, defaults to [prefix]/bin
--lib-prefix=<dir>              : Set the install libary location, defaults to [prefix]/lib
--include-prefix=<dir>          : Set the install header location, defaults to [prefix]/include
--config-dir=<dir>              : Set the location of the safmq.conf file defaults to /etc
--with-fPIC                     : Add the -fPIC flag to the code compliation (needed on some systems)
--with-compile-option=<option>  : Add pass the listed flag to the compiler stage (may be repeated)
--with-link-option=<option>     : Add pass the listed flag to the linker (may be repeated)

Compilation on Windows

Compilation can also occur on Windows systems. Visual C++ 6.0 workspace and project files have been supplied as well as Visual Studio C++ 2005.

SSL Enabled Clients

SAFMQ Clients that wish to use SSL must define the compiler macro SAFMQ_SSL. This macro causes code in the header files to expose features specific to the SSL implementation. If the library being used is SSL enabled, the client must define the SAFMQ_SSL macro, otherwise compilation and linking errors may occur.

Client Applications In Windows

The binary Windows distribution is distributed with static libraries for both Visual C++ 6.0 and Visual Studio C++ 2005. Subtle differences exist between the two versions, so picking the correct library is necessary. Versions have been supplied for debug or release modes; with or without SSL; and with standard libraries statically linked (minimum dependencies) or dynamically linked (smaller binary). This is a total of eight (8) library versions per compiler environment. All packaged versions of the SAFMQ client library on windows are built with the Multi Threaded version of the standard libraries.

Library Runtime Lib SSL Compiler
safmq.lib multi-thread DLL NO VC++ 6.0
safmq-ssl.lib multi-thread DLL YES (-DSAFMQ_SSL) VC++ 6.0
safmq-mindep.lib multi-thread static lib NO VC++ 6.0
safmq-ssl-mindep.lib multi-thread static lib YES (-DSAFMQ_SSL) VC++ 6.0
safmq2005.lib multi-thread DLL NO VS2005 C++
safmq-ssl2005.lib multi-thread DLL YES (-DSAFMQ_SSL) VS2005 C++
safmq-mindep2005.lib multi-thread static lib NO VS2005 C++
safmq-ssl-mindep2005.lib multi-thread static lib YES (-DSAFMQ_SSL) VS2005 C++

If the client application being developed is using an inappropriate version of the SAFMQ client library, linking errors can occur. The most commonly received link error is that a symbol is already defined in a standard library like msvcprtd.lib.

Table of Contents Hierarchy of classes

Safmq Documentation, copyright (c) 2004-2010 Matthew J. Battey, Licensed Under Apache License Ver 2.0
Powered By: Get SAFMQ: Store and Forward Message Queue at Fast, secure and Free Open Source software downloads