This section explains how you build Message Queue programs from C source files. You should already be familiar with writing and compiling C applications.
The Message Queue C client includes the header files (mqcrt.h), the C client runtime shared library mqcrt, and its direct dependency libraries. When writing a Message Queue C client application, you should include the header files and link to the runtime library mqcrt.
The installed locations of the header files and the supporting runtime library depends on the installation method and platform, as listed in the next table.
Table 1–1 Locations of C-API Libraries and Header Files
Installation Method and Platform |
Library |
Header File |
||
---|---|---|---|---|
IPS image on Solaris 86 |
IMQ_HOME/lib (32–bit) IMQ_HOME/lib/amd64 (64–bit) |
IMQ_HOME/include |
||
IPS image on Solaris SPARC |
IMQ_HOME/lib (32–bit) IMQ_HOME/lib/sparcv9 (64–bit) |
IMQ_HOME/include |
||
IPS image on other platforms |
|
|
||
Solaris SVR4 packages on Solaris x86 |
/opt/SUNWimq/lib (32–bit) /opt/SUNWimq/lib/amd64 (64–bit) |
|
||
Solaris SVR4 packages on Solaris SPARC |
/opt/SUNWimq/lib (32–bit) /opt/SUNWimq/lib/sparcv9 (64–bit) |
|
||
Linux rpm packages on Linux |
|
|
Use the appropriate compiler for your platform, as described in the Sun GlassFish Message Queue 4.4 Release Notes.
When compiling a Message Queue C client application, you need to specify the pre-processor definition shown for each platform in Table 1–2. This definition is used to support Message Queue fixed-size integer types.
Table 1–2 Preprocessor Definitions for Supporting Fixed-Size Integer Types
Platform |
Definition |
---|---|
Solaris |
SOLARIS |
Linux |
LINUX |
AIX |
AIX |
Windows |
WIN32 |
When building a Message Queue C client application, you should be aware that the Message Queue C runtime library is a multi-threaded library and requires C++ runtime library support:
On Solaris, this support is provided by the Sun WorkShop 6 libCrun C++ runtime library.
On Linux, this support is provided by the gcc/g++ libstdc++ runtime library.
On AIX, this support is provided by the C++ runtime library in the in the XLC/C++ Runtime Environment.
On Windows, this support is provided by Microsoft Windows Visual C++ runtime library msvcrt.