Linking libraries
You need the following libraries:
- Link your programs with the appropriate library provided by WebSphere MQ.
In a non-threaded environment, link to one of the following libraries:
Library file Program/exit type libmqm.a Server for C libmqic.a Client for C In a threaded environment, link to one of the following libraries:
Library file Program/exit type libmqm_r.a Server for C libmqic_r.a Client for C For example, to build a simple threaded WebSphere MQ application from a single compilation unit run the following commands.
For 32–bit applications:
$ xlc_r -o amqsputc_32_r amqsput0.c -I/usr/mqm/inc -L/usr/mqm/lib -lmqm_rwhere amqsput0 is a sample program.For 64–bit applications:
$ xlc_r -q64 -o amqsputc_64_r amqsput0.c -I/usr/mqm/inc -L/usr/mqm/lib64 -lmqm_rwhere amqsput0 is a sample program.If you want to use the programs on a machine that has only the WebSphere MQ client for AIX installed, recompile the programs to link them with the client library (-lmqic) instead.
- If you are writing an installable service (see the WebSphere MQ System Administration Guide for further information), we need to link to the libmqmzf.a library in a non-threaded application and to the libmqmzf_r.a library in a threaded application.
- If you are producing an application for external coordination by an XA-compliant transaction manager such as IBM TXSeries, Encina, or BEA Tuxedo, we need to link to the libmqmxa.a (or libmqmxa64.a if your transaction manager treats the 'long' type as 64-bit) and libmqz.a libraries in a non-threaded application and to the libmqmxa_r.a (or libmqmxa64_r.a) and libmqz_r.a libraries in a threaded application.
- You need to link trusted applications to the threaded WebSphere MQ libraries. However, only one thread in a trusted application on WebSphere MQ on UNIX systems can be connected at a time.
- You must link WebSphere MQ libraries before any other product libraries.
Parent topic:
Preparing C programs
fg16160_