Compiling the Reference Message Exit sample

To compile the Reference Message Exit sample, use the command for the platform on which IBM® MQ is installed.

Required libraries

See External libraries for a list of 32-bit and 64-bit libraries that you can use.

MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.

To compile amqsxrma, use the following commands:

[AIX]

On AIX®

xlc_r -q64 -e MsgExit -bE:amqsxrm.exp -bM:SRE -o amqsxrm_64_r
-I MQ_INSTALLATION_PATH/inc -L MQ_INSTALLATION_PATH/lib64 -lmqm_r amqsqrma.c
[IBM i]

On IBM i

CRTCMOD MODULE(MYLIB/AMQSXRMA) SRCFILE(QMQMSAMP/QCSRC)
TERASPACE(*YES *TSIFC)
Note:
  1. To create your module so that it uses the IFS file system, add the option SYSIFCOPT(*IFSIO)
  2. To create the program for use with non-threaded channels use the following command: CRTPGM PGM(MYLIB/AMQSXRMA) BNDSRVPGM(QMQM/LIBMQM)
  3. To create the program for use with threaded channels use the following command: CRTPGM PGM(MYLIB/AMQSXRMA) BNDSRVPGM(QMQM/LIBMQM_R)
[Linux]

On Linux®

$ gcc -m64 -shared -fPIC -o /var/mqm/exits64/amqsxrma amqsqrma.c -I MQ_INSTALLATION_PATH/inc
-L MQ_INSTALLATION_PATH/lib64 -Wl,-rpath= MQ_INSTALLATION_PATH/lib64 -Wl,-rpath=/usr/lib64 -lmqm_r
[Windows]

On Windows

IBM MQ now supplies the mqm library with client packages as well as server packages, so the following example uses mqm.lib instead of mqmvx.lib:
cl amqsqrma.c /link /out:amqsxrm.dll /dll mqm.lib mqm.lib /def:amqsxrm.def