ILE C/C++ Programmer's Guide

Instructions

  1. Create a source file dummy.cpp, using the source code shown in Figure 21.
  2. Compile and bind dummy.cpp into a service program PRINT:
    CRTCPPMOD MODULE(MYLIB/DUMMY) SRCSTMF(dummy.cpp)
    CRTSRVPGM SRVPGM(MYLIB/PRINT) MODULE(MYLIB/DUMMY) EXPORT(*ALL)
    
  3. Create the source file for program MYPROG, using the source code shown in Figure 21.
  4. Create the program MYPROG from myprog.cpp and bind it to the service program PRINT. Enter the following commands:
    CRTCPPMOD MODULE(MYLIB/MYPROG) SRCSTMF(myprog.cpp)
    CRTPGM    PGM(MYLIB/MYPROG) MODULE(MYLIB/MYPROG)
    		BNDSRVPGM(MYLIB/PRINT) OPTION(*UNRSLVREF)
    

    The option *UNRSLVREF ensures that the program binds to the service program, although there is no matching export for MYPROG's import void print(char *).


[ Top of Page | Previous Page | Next Page | Table of Contents ]