Sun Java System Message Queue 4.2 Developer's Guide for C Clients

Building C Clients

This section explains how you build Message Queue programs from C source files. You should already be familiar with writing and compiling C applications.

Header Files and Shared Libraries

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.

For each platform, the next table lists the installed location of the header files and the supporting runtime library.

Table 1–1 Locations of C-API Libraries and Header Files

Platform 

Library 

Header File 

Solaris/x86

/opt/SUNWimq/lib (32–bit)

/opt/SUNWimq/lib/amd64 (64–bit)


/opt/SUNWimq/include

Solaris/SPARC

/opt/SUNWimq/lib (32–bit)

/opt/SUNWimq/lib/sparcv9 (64–bit)


/opt/SUNWimq/include

Linux


/opt/sun/mq/lib

/opt/sun/mq/include

Windows


IMQ_HOME\lib

IMQ_HOME\include

Pre-Processor Definitions

Use the appropriate compiler for your platform, as described in the Sun Java System Message Queue 4.2 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 

Windows 

WIN32 

C++ Runtime Library Support

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: