JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server Message Queue 4.5 Developer's Guide for C Clients
search filter icon
search icon

Document Information

Preface

1.  Introduction

Message Queue for the C Developer

Building and Running C Clients

Building C Clients

Header Files and Shared Libraries

Pre-Processor Definitions

C++ Runtime Library Support

Providing Runtime Support

Working With the Sample C-Client Programs

Basic C-Client Programs

Building the Basic C-Client Sample Programs

To Compile and Link on Solaris OS

To Compile and Link on Linux

To Compile and Link on AIX

To Compile and Link on Windows

Running the Basic C-Client Sample Programs

Distributed Transaction Sample Programs

To Set Up Tuxedo as a Distributed Transaction Manager

To Build the Distributed Transaction Sample Programs

To Run the Distributed Transaction Sample Programs

Client Application Deployment Considerations

2.  Using the C API

3.  Client Design Issues

4.  Reference

A.  Message Queue C API Error Codes

Index

Building and Running C Clients

Message Queue provides several sample Message Queue C-client applications that illustrate how to send and receive messages. Before you run these applications, read through the next two sections to make sure that you understand the general procedure and requirements for building and running Message Queue C-client programs.

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.

The header files are located in IMQ_HOME/include, and the 32-bit runtime library is located in IMQ_HOME/lib. A 64-bit runtime library is available for the following platforms in the specified location:

Pre-Processor Definitions

Use the appropriate compiler for your platform, as described in the Oracle GlassFish Server Message Queue 4.5 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-1. This definition is used to support Message Queue fixed-size integer types.

Table 1-1 Preprocessor Definitions for Supporting Fixed-Size Integer Types

Platform
Definition
Solaris
SOLARIS
Linux
LINUX
AIX
AIX
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:

Providing Runtime Support

To run a Message Queue C-client application, you need to make sure that the application can find the mqcrt shared library. Please consult the documentation for your compiler to determine the best way to do this.

You also need to make sure that the appropriate C++ runtime support library, as described in C++ Runtime Library Support is available.

On Windows you also need to make sure that your application can find the dependent libraries NSPR and NSS that are shipped with Message Queue. These may be different from the NSPR and NSS libraries that are installed on your system to support the Netscape browser and GlassFish Server. The mqcrt shared library depends directly on the NSPR and NSS versions installed with Message Queue. If a different version of the libraries is loaded at runtime, you may get a runtime error specifying that the libraries being used are incompatible. If this happens, look on your system to see if other versions of the NSPR or NSS libraries exist; for example, libnspr4.dll or nss3.dll. If you find such versions, take appropriate action to make sure that Message Queue can access the versions it needs.