Linking libraries

You need to link your programs with the appropriate library provided by MQSeries.

You must link to one or more of the following libraries:

Library file Program/exit type
libmqm.so Server for C
libmqmzse.so For C
libmqic.so Client for C
libmqmcs.so Client for C
libmqmzf.so Installable service
libmqmxa.a XA interface

If you are using an additional product such as ENCINA, you need to find the run-time libraries. There are three ways (the first two are preferred, especially if the module is an exit or trigger monitor):

  1. Link the libraries into /usr/lib/, for example:
      ln -s /opt/encina/lib/*.so /usr/lib
    

    Note:
    You need to check these symbolic links when you install a newer version of ENCINA.
  2. Set LD_LIBRARY_PATH to include the ENCINA library directory (this is in the environment when you run the programs), for example:
      LD_LIBRARY_PATH=/opt/encina/lib  export LD_LIBRARY_PATH
    
  3. Set LD_RUN_PATH to include /opt/encina/lib when you compile the programs.

To compile an ENCINA program on SINIX which uses the MQI:

  LD_RUN_PATH=/opt/encina/lib  export LD_RUN_PATH
  cc -o amqsxaex -I/opt/encina/include amqsxaex.c -lmqm -lmqmcs   \
  -lmqmcs -lmqmzse -lnsl -lsocket -lencina -ldl -lmproc -lext

For DC/OSx, include -liconv on the above command line.



© IBM Corporation 1993, 2002. All Rights Reserved