Build Dynamic Link Libraries for Resources(OS/2, Windows)

Building dynamic link libraries for resources is a simpler process than it was in earlier versions of VisualAge C++. To build a resource DLL follow these steps:

  1. Prepare your resource source (.rc) files.
  2. Specify your resource sources files as sources for the build.
    If you supply more than one resource source file, VisualAge C++ combines them into one resource source file with file extension .rc.
  3. On OS/2, you must also provide a C or C++ source file that is a stub to link with the resource binary. Create a source that declares a variable or function. Unlike previous version of VisualAge C++, VisualAge C++ optimization completely eliminates a file that contains only a comment, so your stub must allocate some memory.
  4. Name the target file and make sure the extension is .dll.
  5. Build. The build process runs the resource compiler to create .res files from your .rc sources, and runs the linker to produce your DLL.

The build automatically creates an import library with the same name as the dynamic link library and with the extension .lib.

Here is an excerpt from a configuration file that builds a resource DLL in a file named myres.dll from a resource file named strings.rc:

target "myres.dll" {
   source "strings.rc"
   if $OS2 {             // OS2 build needs a C or C++ stub
      source "stub.cpp"  // contains: void empty(void) {}
   }
}



Configuration Files


Use Resource Files as Source Files
Add or Change Source Files
Add or Change Targets
Build
Compile and Bind Resources
Build Dynamic Link Libraries
Build Modules That Use DLLs