Using cxx

The cxx command invokes the IBM IBM C/C++ for z/VM compiler to compile a C or C++ application program and build an executable file in one step. The cxx command has the same syntax as the c89 command. A C++ source input file has the form file.cpp or file.cxx. If the C++ input file is a CMS native file, the file type must be CPP or CXX. The IBM C/C++ for z/VM compiler always uses the Program Management binder.

Use the -o option on cxx to specify the name and location of the executable file. For example:
  • To compile and build a C application program source file to create the default executable file a.out in the BFS working directory, specify:
      cxx usersource.c
  • To compile and build a C++ application source file to create the mymod.out executable file in the /app/bin directory, specify:
      cxx -o /app/bin/mymod.out usersource.cpp
  • To compile and build several C application source files to create the mymod.out executable file in the /app/bin directory, specify:
      cxx -o /app/bin/mymod.out usersource.c ottrsrc.c //pwapp.c
  • To compile and build a C++ application source file to create the MYLOADMD MODULE file on disk A, specify:
      cxx -o //myloadmd.module usersource.cpp
  • To compile and build a C application source file with several previously compiled object files to create the executable file zinfo in the /approg/lib BFS directory, specify:
      cxx -o /approg/lib/zinfo usersource.c existobj.o //PWAPP.C