Compiling C Source Code

The following files are required to generate a system object model object class or Presentation Manager application from "C" source code:

Source

H DEF RC DLG

The role of these files in the development of a Presentation Manager application is illustrated in Figure "Compiling and Linking an OS/2 Presentation Manager Application".

Note that certain additional header files are generated by the SOM Precompiler and used in compiling a system object model object class. These files are typically header files used to link the class with its parent, and have no direct bearing on the compilation process.

The following steps are required to compile and link-edit a Presentation Manager application:

  • Compile the source file using a high-level language compiler, to produce an object file (usually with an extension of .OBJ).

  • Link-edit the object file with any other required object files, and possibly one or more run-time libraries, to create an executable file (usually with an extension of .EXE).

  • Compile any Presentation Manager resources using the resource compiler, and incorporate these resources into the application's executable code or place them in a DLL module.

    A number of compiler and link editor options are specified for Presentation Manager applications; these are shown in the example below. The executable file may then be run as a Presentation Manager application under OS/2.

    Note that the third step above is not required if Presentation Manager resources are not used by the application. However, it is envisaged that virtually all Presentation Manager applications will make some use of resources, due to the benefits to be gained through externalization of logic-independent or language-specific application components.

    Note that the command sequences for compiling and link editing an application may be combined and placed in a parameterized OS/2 command file for automated execution. Alternatively, a makefile may be created and the NMAKE utility used to compile and link edit the application.


    [Back: SOM Precompiler Invocation]
    [Next: Module Definition File]