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/ |
(see note 1 ) |
HP-UX |
MQ_INSTALLATION_PATH/samp |
MQ_INSTALLATION_PATH/samp/bin/ah (see note 2 ) |
z/OSĀ® |
thlqual.SCSQCPPS |
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 ) |
- Programs built using the ILE C++ compiler for IBM i are in the library QMQM. The include files are in /QIBM/ProdData/mqm/inc.
- 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.
- 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.