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, 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
libmqic.a library for non-threaded applications, or libmqic_r.a library for threaded applications.

AT&T GIS UNIX
libmqic.so and libmqmcs.so.

If you want to use the programs on a machine that has only the MQSeries client for AT&T GIS UNIX installed, recompile the programs to link them with the client library:

$ /bin/cc -o <prog> <prog>.c -lmqic -lmqmcs -lmqmzse -lnet \
  -lnsl -lsocket -ldl -lc

Compaq OpenVMS Alpha
MQIC.EXE in SYS$SHARE.

Compaq Tru64 UNIX
libmqic.so libraryfor Version 4 non-threaded applications, libmqic_r.so for Version 4 threaded applications, or libmqic.so for Version 5 applications.

DOS
MQIC.LIB.

Your application must also be linked with at least three of the following libraries, one for each protocol, indicating whether you do or do not require it.

MQICN
NetBIOS required

MQICDN
NetBIOS not required

MQICS
SPX required

MQICDS
SPX not required

MQICT
TCP/IP required

MQICDT
TCP/IP not required

SOCKETL
Link to this from the DOS TCP/IP product (if using TCP/IP)

When compiling programs in these environments there are many options available. For example, using Microsoft C7:

/Alfw /Gw /Zpl /J

with a stack size greater than 8 KB, preferably 16 KB.

HP-UX
libmqic.sl.

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

OS/2 Warp
MQIC.LIB.

SINIX and DC/OSx
libmqic.so and libmqmcs.so.

If you want to use the programs on a machine that has only the MQSeries client for SINIX and DC/OSx installed, recompile the programs to link them with the client library:

$cc -o <prog> <prog>.c -lmqic -lmqmcs -lmqmzse -lnsl \
  -lsocket -ldl -lmproc -lext

For DC/OSx append -liconv to the above command line.

Solaris
libmqic.so and libmqmcs.so.

If you want to use the programs on a machine that has only the WebSphere MQ client for Solaris installed, 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.

Sun Solaris, Intel Platform Edition
libmqic.so, libmqmcs.so, or libmqmzse.so

If you want to use the programs on a machine that has only the MQSeries client for Sun Solaris, Intel Platform Edition installed, recompile the programs to link them with the client library:

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

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

Windows 3.1
LIBW.LIB, LLIBCEW.LIB, MQIC.LIB.

Windows 95, Windows
MQIC32.LIB.

 

Running 16-bit and 32-bit Windows clients

Previous versions of the MQSeries clients for Windows 95, Windows 98, and Windows NT included a version of MQIC.DLL that was 32-bit. When client code that was compiled as 16-bit is run using this DLL, it fails due to a name clash caused by the file MQIC.DLL. This has been rectified by replacing MQIC.DLL with MQIC32.DLL.

The file MQIC.DLL is no longer included in the 32-bit Windows client. If you have code linked with the MQIC.DLL you need to relink. If this is not possible, you can copy the MQIC32.DLL file to MQIC.DLL. Note that doing this will prevent you from running mixed 16-bit and 32-bit environments.

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.