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]AIX®
MQ_INSTALLATION_PATH/samp
MQ_INSTALLATION_PATH/samp/bin/ia
[IBM i]IBM i
/QIBM/ProdData/mqm/samp/
(see note 1 )
[Linux]Linux®
MQ_INSTALLATION_PATH/samp
None
[Solaris]Solaris
MQ_INSTALLATION_PATH/samp
MQ_INSTALLATION_PATH/samp/bin/as
[Windows]Windows
MQ_INSTALLATION_PATH\tools\cplus\samples
MQ_INSTALLATION_PATH\tools\cplus\
samples\bin\vn
(see note 2 )
[z/OS]z/OS®
thlqual.SCSQCPPS
 
Notes:
  1. [IBM i]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. [Windows]Programs built using the Microsoft Visual Studio 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.