Universal Messaging C++ Environment Setup : Linux
The guide below explains how the Universal Messaging C++ environment can be set up for compiling and running the applications on Linux 64-bit operating system.
Running a Universal Messaging C++ application requires the system to know the location of certain runtime libraries. OpenSSL is assumed to be installed and the location known to the system. The POCO libraries and Universal Messaging.so are found in cplus/linux64/lib. To make these libraries known to the system, several methods can be used:
1. By setting the LD_LIBRARY_PATH environment variable:
export LD_LIBRARY_PATH=/home/username/Universal Messaging_5.0.xxxx/cplus/linux/lib:$LD_LIBRARY_PATH
This will allow programs to be compiled and run in the current shell.
2. In order to make the libraries globally available you can copy the libraries into /usr/local/lib.
3. Another method to make the libraries globally available is by using ldconfig. This requires root access to the system:
[root@host ~]$ cd /etc/ld.so.conf.d
[root@host ld.so.conf.d]$ echo /home/username/Universal Messaging_5.0.xxxx/cplus/linux/lib>nirvana.conf
[root@host ld.so.conf.d]$ ldconfig
The above code first navigates the the required directory. It then creates a new file called nirvana.conf (this can be any file name with extension ".conf") containing the location of the libraries. Once this file is created, ldconfig is run (must be run as root) which creates the necessary links.
To compile a Universal Messaging C++ application, the location of the shared libraries must be known by the system as described above. The compiler must also know the location of certain C++ headers. These headers are found in cplus/include. The cplus/example directory contains sample applications written using the Universal Messaging C++ API as well as the make files which can be used to compile them. In order to compile your own applications, please refer to these makefiles as a template. Each application comes pre-compiled, the executable (no file extension) can be found in the application's directory (cplus/examples/applicationName).
Compiling the Sample Applications
Once the environment has been set up as described above, the sample applications can be compiled by navigating to the application's directory (cplus/examples/applicationName) and running:
[user@host channeliterator]$ make
To clean this directory so that the application can be recompiled, run:
[user@host channeliterator]$ make clean
The executable (no file extension) will now be present in the same directory as the source code after compilation.