Building applications in C++ on Compaq Tru64 UNIX Version 4.0

This section describes how to build application programs written in C++ to run under Compaq Tru64 UNIX Version 4.0.

For more information on using MQSeries with C++, see the WebSphere MQ Using C++.

C++ language include files

The WebSphere MQ C++ include files are listed in Table 21. They are installed in the directory /opt/mqm/inc/. The include files are symbolically linked into /usr/include.

Table 21. C++ include files for MQSeries (Compaq Tru64 UNIX Version 4.0)

File name Contents
<cmqc.h> MQI data structures and manifest constants
<imqi.hpp> C++ MQI classes (includes cmqc.h and imqtype.h)
<imqtype.h> Defines the ImqBoolean data type
Note:
The files are protected against multiple declaration, therefore you can include them many times.

Preparing C++ programs

Work in your usual environment. Precompiled C++ programs are supplied in the /opt/mqm/samp/bin/ff directory. Here is an example instruction for building the sample program imqsput0.cpp in a nonthreaded environment:

$ cxx -std1 -o imqsput imqsput0.cpp -limqs23ff -limqb23ff

Here is an example instruction for building the sample program imqsput0.cpp in a threaded environment:

$ cxx -std1 -pthread -o imqsput imqsput0.cpp -limqs23ff_r -limqb23ff_r

If you want to use the programs on a machine on which only the MQSeries client for Compaq Tru64 UNIX is installed, recompile the programs to link them with the client library. Here is an example instruction for building the sample program imqsput0.ccp as a nonthreaded client:

$ cxx -std1 -o imqsput imqsput0.cpp -limqc23ff -limqb23ff

Here is an example instruction for building the sample program imqsput0.cpp as a threaded client:

$ cxx -std1 -pthread -o imqsput imqsput0.cpp -limqc23ff_r -limqb23ff_r

Linking libraries

In a nonthreaded environment, you must link to one of the following libraries:

Library file Program or exit type
libimqs23ff.so Server for C++
libimqc23ff.so Client for C++

In a threaded environment, you must link to one of the following libraries:

Library file Program or exit type
libimqs23ff_r.so Server for C++
libimqc23ff_r.so Client for C++
Note:
If you are writing an installable service (as described in WebSphere MQ System Administration Guide), you need to link to the libmqmzf.so library.


© IBM Corporation 1993, 2002. All Rights Reserved