Linking C applications with the WebSphere MQ client code

Having written your WebSphere MQ application that you want to run on the WebSphere MQ client, you must link it to a queue manager. You can do this in two ways:

  1. Directly, in which case the queue manager must be on the same machine as your application
  2. To a client library file, which gives you access to queue managers on the same or on a different machine

WebSphere MQ provides a client library file for each environment:

AIX(R)
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(R)
libmqic.so library for non-threaded applications, or libmqic_r.so library for threaded applications.
Solaris
libmqic.so.

If you want to use the programs on a machine that has only the WebSphere MQ client for Solaris installed, you must recompile the programs to link them with the client library:

$ /opt/SUNWspro/bin/cc -o <prog> <prog> c -mt -lmqic \
-lmqmcs -lsocket -lc -lnsl -ldl

The parameters must be entered in the correct order, as shown.

Windows(R)
MQIC32.LIB.