Universal Messaging 10.3 | Developer Guide | Enterprise APIs | Enterprise Developer's Guide for C++ | C++ Prerequisites | Environment Setup: Linux and OS X
 
Environment Setup: Linux and OS X
The guide below explains how the C++ environment for Universal Messaging can be set up for compiling and running the applications on a Linux or OS X operating system.
Note:
Setting up the environment involves the use of the console at the operating system level. General information about using the console for this purpose is contained in the section Running the Sample Applications.
Running a C++ application for use with Universal Messaging 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 Nirvana.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=
<InstallDir>/UniversalMessaging/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]$ cd /etc/ld.so.conf.d
[root]$ echo <InstallDir>/UniversalMessaging/cplus/linux/lib>nirvana.conf
[root]$ ldconfig
The above code first navigates 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 C++ application for use with Universal Messaging, 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/examples directory contains sample applications written using the C++ API of Universal Messaging 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
In order to make compilation easier, we have provided a CMake script which can be used to generate the build files for the target platform. CMake can be downloaded from http://www.cmake.org/cmake/resources/software.html.
In the following descriptions, "[AppName]" refers to the name of the application you want to compile. The source code of the sample applications is available at the location:
<InstallDir>/UniversalMessaging/cplus/examples/
Linux
On Linux, use the following commands at the console:
1. cmake .
2. cd [AppName]
3. make
4. export PATH=$PATH:[Location_Of_UM_Install]/cplus/lib/x86_64
5. ./[AppName]
OS X
On OS X, use the following commands at the console:
1. cmake .
2. cd [AppName]
3. make
4. export DYLD_LIBRARY_PATH=[Location_Of_UM_Install]/cplus/lib/x86_64
5. ./[AppName]