Preparing C programs

Work in your normal environment. Precompiled C programs are supplied in the /opt/mqm/samp/bin directory.

Preparing C programs on HP-UX V11.00

The following is an example of how to build the sample program amqsput0 in a non-threaded environment:

cc -Aa -D_HPUX_SOURCE -o amqsput0 amqsput0.c -lmqm

The following is an example of how to build the sample program amqsput0 in a POSIX draft 10 threaded environment:

cc -Aa -D_HPUX_SOURCE -o amqsput0 amqsput0.c -lmqm_r -lpthread

The following is an example of how to build the sample program amqsput0 in a POSIX draft 4 (DCE) threaded environment:

cc -Aa -D_HPUX_SOURCE -D_PTHREADS_DRAFT -o amqsput0  \
amqsput0.c -lmqm_d -ld4r -lcma

If you want to use the programs on a machine that has only the WebSphere MQ client for HP-UX installed, recompile the programs to link them with the client library instead. The following is an example of how to build a non-threaded client:

cc -Aa -D_HPUX_SOURCE -o amqsput0 amqsput0.c -lmqic

The following is an example of how to build a POSIX draft 10 threaded client:

cc -Aa -D_HPUX_SOURCE -o amqsput0 amqsput0.c -lmqic_r -lpthread

The following is an example of how to build a POSIX draft 4 (DCE) threaded client:

cc -Aa -D_HPUX_SOURCE -D_PTHREADS_DRAFT4 -0 amqsput0  \
amqsput0.c -lmqic_d -ld4r -lcma

Linking libraries

The following lists the libraries you will need.



© IBM Corporation 1993, 2002. All Rights Reserved