Preparing C programs

Precompiled C programs are supplied in the /opt/mqm/samp/bin directory. For further information on programming 64 bit applications see Appendix F. Coding standards on 64 bit platforms.

To compile, for example, the sample program amqsput0 for 32-bit applications:

  cc -xarch=v8plus -mt -o  amqsput_32 amqsput0.c -I/opt/mqm/inc -L/opt/mqm/lib 
     -R/opt/mqm/lib -R/usr/lib/32 -lmqm -lmqmcs -lmqmzse -lsocket -lnsl -ldl

For 64-bit applications:

 cc -xarch=v9 -mt -o  amqsput_64 amqsput0.c -I/opt/mqm/inc -L/opt/mqm/lib64 
     -R/opt/mqm/lib64 -R/usr/lib/64 -lmqm -lmqmcs -lmqmzse -lsocket -lnsl -ldl 

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 (-lmqic) instead.

If you use the unsupported compiler /usr/ucb/cc, your application might compile and link successfully. However when you run it, it will fail when it attempts to connect to the queue manager.

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 (-lmqic) instead.