How to use YACL with Watcom C++

Last update: June 2, 1997

This file provides directions on how to build YACL and its demo programs using Watcom C++.

Building YACL

Caveat: YACL requires Watcom C++ 10.0a or later, because earlier versions of Watcom C++ do not provide adequate support for templates.

Known problems

The template support in Watcom C++ 10.0a is still buggy. So if you attempt to instantiate your own templates using the YACL containers, you might get lots of syntax errors. This happens, for example, if you try to instantiate a Set of Points in ui/containr.cxx. I don't know if the latest release of the compiler (the 10.5 version) fixes these problems. The reason why 10.0a compiles YACL now, and it didn't before, is just that I found a workaround for its bugs and restructured the YACL code.

Generally, though, Watcom C++ seems to produce smaller executables, particularly under OS/2. I'd guess this is because of the linker option "eliminate" which doesn't seem to be available for other compilers.

Watcom C++ sometimes doesn't do type casts properly. For example, the following statement

has to be parenthesized under Watcom:

The Ctl3d library and the -zz option. Under Windows 3.1 and Windows NT 3.51, you can use the Ctl3d library to produce 3-d dialog effects. To do this, however, there is a somewhat ugly aliasing to be done (see uidemo/wtcappmk.ctl). Try using the -zz option to get around this if necessary. Using -zz under Windows NT 4.0, however, causes the Watcom linker to fail to link the UI demos -- it gives an error that there is a "multiply defined start symbol cstrwwt in clib3r.lib" (whatever that means).

Watcom C++ under OS/2 and Windows NT. Under OS/2 and Windows NT, the Watcom linker is unable to retrieve the main program from the UI library; don't know why. It complains that a start address is not found. This does not happen under Windows, which is weird. The workaround I use is to explicitly include ui/mainprog.obj in the linker command. You can see this in uidemo/wtcappmk.ctl, which is included by all the uidemo makefiles.

Shared libraries (DLLs). You can build YACL's base and I/O libraries as DLLs using Watcom C++, via the make command

These work fine, with the base demos. However, even though the UI library builds successfully as a DLL, the UI demos do not run at all (i.e., they exit immediately). I don't yet know why, and am still investigating. All assistance is welcome.