You need to link your programs with the appropriate library provided by WebSphere MQ.
If you are not working in a DCE-threaded environment or using
CICS, you must link to one of the following libraries:
Library file | Program/exit type |
---|---|
libmqm.so | server for C |
libmqic.so | client for C |
If you are working in a DCE-threaded environment or using CICS, you must link to the C library, libmqm_r.so.
Notes:
When you compile dynamic libraries, or shared objects, for use with MQSeries for SINIX and DC/OSx, you must use the cc command in the final step that creates the library or object, and not merely the ld command. This is because the cc command automatically links various initialization data that is needed for proper dynamic linking and loading.
The order of the libraries specified is important. The following is an example of how to build the sample program amqsput0 for SINIX:
cc -o amqsput0 -lmqm -lmqmcs -lmqmzse -lnsl \ -lsocket -ldl -lmproc -lext amqsput0.c
For DC/OSx Version cd087, include -liconv -lresolv on the above command, as shown below:
cc -o amqsput0 -lmqm -lmqmcs -lmqmzse -lnsl \ -lsocket -ldl -liconv -lresolv -lmproc -lext amqsput0.c
In the same way, for versions preceding cd087 of DC/OSx, include -liconv.
cc -c -I/opt/encina/include amqsxaex.c
ln -s /opt/encina/include/* /usr/include