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]](ngaix.gif)
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]](ngibmi.gif)
On IBM i
CRTCMOD MODULE(MYLIB/AMQSXRMA) SRCFILE(QMQMSAMP/QCSRC)
TERASPACE(*YES *TSIFC)
Note:
- To create your module so that it uses the IFS file system, add the option
SYSIFCOPT(*IFSIO) - To create the program for use with non-threaded channels use the following command:
CRTPGM PGM(MYLIB/AMQSXRMA) BNDSRVPGM(QMQM/LIBMQM) - To create the program for use with threaded channels use the following command:
CRTPGM PGM(MYLIB/AMQSXRMA) BNDSRVPGM(QMQM/LIBMQM_R)
![[Linux]](nglinux.gif)
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]](ngwin.gif)
On Windows
IBM MQ now supplies the mqm library with client packages as well as server packages, so the following example usesmqm.lib instead of
mqmvx.lib:
cl amqsqrma.c /link /out:amqsxrm.dll /dll mqm.lib mqm.lib /def:amqsxrm.def