C++ sample programs

Four sample programs are supplied, to demonstrate getting and putting messages.

The sample programs are:
  • HELLO WORLD (imqwrld.cpp)
  • SPUT (imqsput.cpp)
  • SGET (imqsget.cpp)
  • DPUT (imqdput.cpp)

The sample programs are located in the directories shown in Table 1.

MQ_INSTALLATION_PATH represents the high-level directory in which IBM® MQ is installed.

Table 1. Location of sample programs
Environment
Directory containing source
Directory containing built
programs
AIX®
MQ_INSTALLATION_PATH/samp
MQ_INSTALLATION_PATH/samp/bin/ia
[IBMi]
IBM i
[IBMi]
/QIBM/ProdData/mqm/samp/
[IBMi]
(see note 1 )
HP-UX
MQ_INSTALLATION_PATH/samp
MQ_INSTALLATION_PATH/samp/bin/ah
(see note 2 )
[z/OS]
z/OS®
[z/OS]
thlqual.SCSQCPPS
[z/OS]
None
Solaris
MQ_INSTALLATION_PATH/samp
MQ_INSTALLATION_PATH/samp/bin/as
Linux®
MQ_INSTALLATION_PATH/samp
MQ_INSTALLATION_PATH/samp/bin/
Windows
MQ_INSTALLATION_PATH\tools\cplus\samples
MQ_INSTALLATION_PATH\tools\cplus\
samples\bin\vn
(see note 3 )
Notes:
  1. Programs built using the ILE C++ compiler for IBM i are in the library QMQM. The sample files are in /QIBM/ProdData/mqm/samp.
  2. Programs built using the HP ANSI C++ compiler are found in directory MQ_INSTALLATION_PATH/samp/bin/ah. For further information, see Building C++ programs on HP-UX.
  3. Programs built using the Microsoft Visual Studio are found in MQ_INSTALLATION_PATH\tools\cplus\samples\bin\vn. For further information about these compilers, see Building C++ programs on Windows.