Compiling channel exit programs on Windows, UNIX and Linux systems

Use the following examples to help you compile channel-exit programs for Windows, UNIX and Linux systems.


Windows

The compiler and linker command for channel-exit programs on Windows:
cl.exe /Ic:\mqm\tools\c\include /nologo /c myexit.c
link.exe /nologo /dll myexit.obj /def:myexit.def /out:myexit.dll


UNIX and Linux systems

In these examples exit is the library name and ChannelExit is the function name. On AIX the export file is called exit.exp. These names are used by the channel definition to reference the exit program using the format described in MQCD- channel definition. See also the MSGEXIT parameter of the DEFINE CHANNEL command.

Sample compiler and linker commands for channel exits on AIX:
$ xlc_r -q64 -e MQStart -bE:exit.exp -bM:SRE -o /var/mqm/exits64/exit
exit.c -I/usr/mqm/inc
Sample compiler and linker commands for channel-exits on Linux where the queue manager is 32 bit:
$ gcc -shared -fPIC -o /var/mqm/exits/exit exit.c -I/opt/mqm/inc
Sample compiler and linker commands for channel-exits on Linux where the queue manager is 64-bit:
$ gcc -m64 -shared -fPIC -o /var/mqm/exits64/exit exit.c -I/opt/mqm/inc

On the client, a 32 bit or 64 bit exit can be used. This exit must be linked to mqic_r.

On AIX, all functions that are called by IBM MQ must be exported. A sample export file for this make file:
#
!channelExit
MQStart
Parent topic: Channel-exit programs for messaging channels