Compiling C++ sample programs for iSeries

This section is aimed at the C++ programmer who wants to write programs for the i5/OS platform.

IBM(R) ILE C++ for iSeries(TM) is a native compiler for C++ programs. The following instructions describe how to use it compiler to create WebSphere(R) MQ C++ applications. Users of the VisualAge(R) cross-compilers must interpret the instructions according to their version of the product.

  1. Install the ILE C++ for iSeries compiler as directed in the Read Me first! manual that accompanies the product.
  2. Ensure that the QCXXN library is in your library list.
  3. Create the HELLO WORLD sample program:
    1. Create a module:
       CRTCPPMOD MODULE(MYLIB/IMQWRLD) +
       SRCSTMF('/QIBM/ProdData/mqm/samp/imqwrld.cpp') +
       INCDIR('/QIBM/ProdData/mqm/inc') DFTCHAR(*SIGNED) +
       TERASPACE(*YES)
      The source for the C++ sample programs can be found in /QIBM/ProdData/mqm/samp and the include files in /QIBM/ProdData/mqm/inc.

      Alternatively, the source can be found in library SRCFILE(QCPPSRC/LIB) SRCMBR(IMQWRLD).

    2. Bind this with WebSphere MQ-supplied service programs to produce a program object:
       CRTPGM PGM(MYLIB/IMQWRLD) MODULE(MYLIB/IMQWRLD) +
       BNDSRVPGM(QMQM/IMQB23I4 QMQM/IMQS23I4)
      See iSeries for alternative service programs that you can use.
    3. Execute the HELLO WORLD sample program, using SYSTEM.DEFAULT.LOCAL.QUEUE:
       CALL PGM(MYLIB/IMQWRLD)