Packaging Your Application

Using Compiler Options with the Open Class Library

All Open Class executables must use the following options:

gen(rtti, yes)
link(padding, no)
lang(nokeyword, "bool")
lang(nokeyword, "true")
lang(nokeyword, "false")
link(linkwithmultithreadlib, yes)

To use dynamic linking, specify link(linkwithsharedlib, yes), to use static linking specify link(linkwithsharedlib, no).

Note: When statically linking on OS/2 and Windows, this option automatically pulls in the necessary Open Class Library import libraries
On AIX, you must specify the static libraries at link time.

Using Reserved Pragma Priority Values

The Open Class Library reserves the use of #pragma priority values in the range of -2147482624 through -2147481600. The C++ compiler reserves the range below that. As a result, avoid using a #pragma priority value less than -2147481599 (this is equivalent to INT_MIN + 2048) to control the order of static object construction in your Open Class Library application.

Understanding Open Class Error and Exception Output

Although Open Class is designed to catch as many errors as possible during the compilation and link steps, some errors can only be detected at run time. The classes in Open Class throw C++ exceptions to indicate runtime errors. Errors messages describing the exception can be seen while debugging, or can be seen in trace output sent to STDOUT, STDERR or a queue; trace output is only seen if you have turned tracing on. Your own classes can also throw C++ exceptions and output trace information in the same way, by using classes provided in Open Class.

Linking an Application to the Open Class Library

"On OS/2 and Windows, you do not need to specify which libraries to use because this happens automatically via #pragma library statements. Only if you build with the link(defaultLibs,no) will you need to manually include the names of the import libraries (if dynamically linking) or object libraries (if statically linking).

On AIX, you must specify exactly which libraries should be used.

The following additional rules apply when you build your application with the dynamic libraries, instead of the static object libraries:

  1. A DLL using the Open Class Library must link dynamically to the Open Class Library code (that is, you must link with each import library). In other words, if you build a DLL that uses Open Class, then you must not build this DLL with the link(linkwithsharedLibs,no) option.
  2. An .exe using the Open Class Library and calling a DLL that also uses the class library must link dynamically to the Open Class Library (that is, you must link with each import library).
  3. An .exe or .dll file should not link both dynamically and statically to the Open Class Library code.

Note: The cpporr40.dll file is the resource DLL used by the Open Class Library for resources that we provide (such as tool bar button bitmaps, animated buttons, bitmaps, container direct manipulation icons, and more). Because this file is loaded dynamically, you need the file when your application is statically or dynamically linked.

You can set the environment variable ICLUI_RESLIB or use ICurrentApplication::setResourceLibrary() to change the default name of this DLL.

Link your AIX application to the Open Class Library by specifying either the non-shared (static) or shared libraries at link time. For the static libraries, the letter s is not appended to the filename. When specifying the shared libraries at link time, append the letter s to the filename.

Note: The first four letters of the CCL controls library (CPPOQI40.DLL) should be the same as the first four letters of the UI classes library (CPPOUI40.DLL) for dynamically linked applications. If your application statically links with the CCL controls library, you may also use the first four letters of your executables instead of those of the UI classes library.



Tracing Exceptions
Following Conventions