Preparing C programs

The WebSphere MQ C include files are listed in Table 24. They are installed in the directory /opt/mqm/inc/. The include files are symbolically linked into /usr/include.

Table 24. C include files for WebSphere MQ

File name Contents
<cmqc.h> Call prototypes, data types, structures, return codes, and constants
<cmqcfc.h> Definitions for programmable commands (PCFs)
<cmqxc.h> Definitions for channel exits and data-conversion exits
<cmqzc.h> Definitions for installable services
Note:
The files are protected against multiple declaration, so you can include them many times.

Compiling C programs

Precompiled C programs are supplied in the /opt/mqm/samp/bin directory. To build a sample from source code, use the gcc compiler.

For example, to compile the sample program amqsput0.c, for single-threaded applications:

  gcc -o amqsput0 amqsput0.c -lmqm

If you want to use the programs on a machine that has only the WebSphere MQ for Linux for Intel and Linux for zSeries client installed, recompile the programs to link them with the client library instead. That is, for single-threaded applications:

  gcc -o amqsput0 amqsput0.c -lmqic


© IBM Corporation 1993, 2002. All Rights Reserved