Precompiled C programs are supplied in the /usr/mqm/samp/bin
directory. Use the ANSI compiler and run the following command:
$ cc -o <amqsput> <amqsput>.c -lmqm
where amqsput is a sample program.
If you want to use the programs on a machine which has only the WebSphere
MQ client for AIX installed, recompile the programs to link them with the
client library (-lmqic) instead.
You will need the following libraries:
- If your application is running in a DCE client environment you will need
to copy the DCE library, libxdsom.a, on to your machine.
- You need to link your programs with the appropriate library provided by
WebSphere MQ.
In a non-threaded environment you must 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, you must 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 on AIX 4.3 run the following command:
$ xlc_r7 -o myapp myapp.c -lmqm_r
where myapp is the name of your program.
Notes:
- If you are writing an installable service (see WebSphere MQ System Administration
Guide for further information), you 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 XA switch load file for external coordination by
an XA-compliant transaction manager such as IBM CICS, Transarc Encina, or
Novell Tuxedo, you need to link to the libmqmxa.a library in a
non-threaded application and to the libmqmxa_r.a library 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.
- To run the sample Encina program, link against the following
libraries:
Also, link to the Encina and DCE libraries:
- libEncServer.a
- libEncina.a
- libdce.a
The sample must be compiled and linked using xlc_r4.
- You must link WebSphere MQ libraries before any other product libraries
(in this case, DCE and Encina). For example:
cc -o put put.c -lmqm_r -ldce
This ensures that any operating system functions that have been redefined
by DCE are also used by WebSphere MQ.
© IBM Corporation 1993, 2002. All Rights Reserved