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.

Environment
Directory containing source
Directory containing built
programs
AIX
MQ_INSTALLATION_PATH/samp
MQ_INSTALLATION_PATH/samp/bin/ia
IBM i /QIBM/ProdData/mqm/samp/
 
Linux
MQ_INSTALLATION_PATH/samp
None
Windows
MQ_INSTALLATION_PATH\tools\cplus\samples
MQ_INSTALLATION_PATH\tools\cplus\
samples\bin\vn
(see note 2 )
z/OS
thlqual.SCSQCPPS
 
Notes:
  1. Programs built using the ILE C++ compiler for IBM i are in the library QMQM. The include files are in /QIBM/ProdData/mqm/inc.
  2. 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.

Parent topic: Developing C++ applications