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
(see note 1 )
[AIX][MQ 9.4.0 Jun 2024]AIX
MQ_INSTALLATION_PATH/samp
MQ_INSTALLATION_PATH/samp/bin/ca
(see note 2 )
[IBM i]IBM i
/QIBM/ProdData/mqm/samp/
(see note 3 )
[Linux]Linux®
MQ_INSTALLATION_PATH/samp
None
[Windows]Windows
MQ_INSTALLATION_PATH\tools\cplus\samples
MQ_INSTALLATION_PATH\tools\cplus\
samples\bin\vn
(see note 4 )
[z/OS]z/OS®
thlqual.SCSQCPPS
 
Notes:
  1. [AIX]Programs that were built with the IBM XL C/C++ for AIX 16 compiler are located in the "ia" folder. [Deprecated][MQ 9.4.0 Jun 2024]Support for this compiler was deprecated in IBM MQ 9.4.0 (for Long Term Support releases, and IBM MQ 9.3.5 for Continuous Delivery releases).[MQ 9.4.2 Feb 2025]The XL C/C++ for AIX 16 compiler was removed in IBM MQ 9.4.2.
  2. [AIX][MQ 9.4.0 Jun 2024]Programs that were built with the IBM Open XL C/C++ for AIX 17 compiler are located in the "ca" folder.
  3. [IBM i]Programs built using the ILE C++ compiler for IBM i are in the library QMQM. The source files are in /QIBM/ProdData/mqm/samp.
  4. [Windows]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.