Linking C applications with the IBM MQ MQI client code

Having written your IBM MQ application that you want to run on the IBM MQ MQI client, you must link it to the IBM MQ MQI client code.

We can link our application to the IBM MQ MQI client code in two ways:
  1. Directly, by connecting our application to a queue manager, in which case the queue manager must be on the same machine as our application.
  2. To a client library file, which gives you access to queue managers on the same or on a different machine.
IBM MQ provides a client library file for each environment:

    AIX
    libmqic.a library for non-threaded applications, or libmqic_r.a library for threaded applications.

    HP-UX
    libmqic.sl library for non-threaded applications, or libmqic_r.sl library for threaded applications.

    Linux
    libmqic.so library for non-threaded applications, or libmqic_r.so library for threaded applications.

    IBM i
    Bind client application with LIBMQIC client service program for non-threaded applications, or LIBMQIC_R service program for threaded applications.

    Solaris
    libmqic.so. If you want to use the programs on a machine that has only the IBM MQ MQI client for Solaris installed, you must recompile the programs to link them with the client library:
    $ /opt/SUNWspro/bin/cc -o prog_name prog_name c -mt -lmqic \
    -lsocket -lc -lnsl -ldl
    
    The parameters must be entered in the correct order, as shown.

    Windows
    MQIC32.LIB.