How to install OWL Next

by Vidar Hasfjord, based on the article by Greg Chicares.
  1. Prerequisites
  2. Downloads
  3. Patching
  4. Building

Prerequisites

OWL is copyrighted software owned by Borland, hence you need a lisense of one of their products that includes the OWL source code. OWL Next is distributed as patches to that source. The supported products are Borland C++ version 5.01 or 5.02, or Borland C++ Builder version 3, 4 or 5. All of these products include slightly different revisions of the Borland OWL source code.

Note that earlier Borland products have a outdated version of OWL that cannot be upgraded to OWL Next. Unfortunately, Borland C++ Builder 6 does not come with OWL. Borland C++ Compiler 5.5, the free command line tool set, doesn't include OWL. You will need one of the commercial releases of the Borland products mentioned above.

Old versions of Borland products can be found at ebay.com, Recycled Software or EMS Professional Software.

Precompiled OWL Next libraries are available. They may be convenient if you have difficulty building the libraries yourself. But to use them, you still need to follow the instructions in this guide, in order to get the patched headers you need.

Downloads

Figure out which patches you need to download. The first patch you need depends on which version of Borland OWL you have a copy of. You need only one of the these patches. The appropriate patch upgrades your Borland OWL source to OWL Next.

For this versionDownload this patch
Borland C++ 5.01owl641.zip
Borland C++ 5.02owl642.zip
Borland C++ 5.02 (Japanese) owl642j.zip
Borland C++ Builder 3owl643.zip
Borland C++ Builder 4owl644.zip
Borland C++ Builder 5owl645.zip

To apply the selected patch you also need to download "owlinst.zip", which contains the program that performs the patching from Borland OWL to OWL Next.

These patches upgrade your source to OWL Next 6.04, but you don't want to use version 6.04 directly because it dates from January 1999. But you do need it as an intermediate step. With version 6.04 as the base version, later patches can be independent of the original Borland OWL source code and its variants.

OWL Next Patching Process

To upgrade OWL Next to the latest stable release, you also need the latest patch — at the time of writing this is "owl604p19.zip", which upgrades OWL Next 6.04 to OWL Next 6.19.

The next few sections describe other files that you might need as well.

Additional headers

Depending on your compiler, you may need any of the following files.

add_fil.zip
adds headers to support certain recently added features. Important: Do not use the headers from this file if you are building OWL Next with VC++.NET!
owl_lin.zip
is needed to build OWL Next with GNU tools, and provides replacements for some mingw headers. Important: Make sure you get the latest version of this file — if you have previously downloaded an older version, you need to replace it.

Build support files

You can build OWL Next with either GNU, Borland, or Microsoft tools. Their object file formats differ, so the file you choose should match the tools you plan to use to compile OWL Next.

obj32b.zip
for any Borland compiler.
obj32v.zip
for the GNU or Microsoft compiler. I believe you no longer need "obj32v.zip" for the GNU toolset, because the object files it contains are created automatically by "gas", the GNU assembler.

These archives contain pre-assembled code for several files that are written in assembly language. They contain routines that handle integers longer than 32 bits and perform some low-level graphics functions. If you want to use Borland tools and have installed their assembler, then you do not need these files because you can assemble them yourself.

Compatibility patches

If you plan to use OWL Next with OWL code that you have already written (or that others have written) using Borland OWL, then you should download one or both of the compatibility patches that this section discusses.

bids.zip
OWL Next replaces not just Borland OWL, but also portions of the Borland class library. It needs to do this because parts of the class library are tightly integrated with OWL. For instance, Borland OWL uses the obsolete container classes in the class library, but OWL Next uses its own replacements instead. If you have to maintain programs that use the old container classes, then download "bids.zip" to get new files that emulate the old container classes. You probably will prefer to use STL in new code you write.
compat.zip
Borland put its OWL and class library headers in separate directories. OWL Next puts all these headers in one directory instead. But old programs expect to find class library headers elsewhere. To allow old programs to work, OWL Next provides dummy headers that reside in a class library directory and simply include the appropriate OWL Next header. Download "compat.zip" to get these dummy headers. These headers are helpful for getting old code to work quickly. But for applications that you plan to maintain, you really should change your source code to reflect the new header locations.

Optional files

There are several other optional files that you might like to have:

owlhlp.zip
has a help file for OWL Next that covers many new classes.
owlext30.zip
gives you some features that members of the OWLExt project added after Borland stopped developing OWL, but before OWL Next development began.

Many other files are available. It's worth looking at everything offered on the download page.

Further information

The OWL Next site contains much more than the download page. Have a look around, and do sign up for the mailing list. I posted several questions to the list while I first installed OWL Next, and got answers to all of them within a few hours.

Patching

Make a new directory for OWL Next. I used "c:\owl", but you can use anything you want. Substitute the directory name you have chosen wherever "c:\owl" is used in the rest of this guide.

Important: Avoid having any names on the path that would not be valid under DOS. That means limiting names to eight characters with no embedded spaces. The OWLInst program may not work if it is run from a folder containing spaces, like "C:\Program Files\OWL Next". If you receive the message "Error command script missing", then move the program to another folder, which path does not contain spaces or long file names.

The following steps are tricky, but you should have no problem if you follow these directions carefully. I've done this many times, and still I always go through this file step by step.

Step 1: Locate the files

Move all the zip files you downloaded to "c:\owl", but don't extract them yet. You can extract any of these zip files with just about any program that handles that format. I found that a 1994 version of "pkunzip" worked fine for everything as long as I told it to respect the pathnames that are stored in some of the download files.

Step 2: Extract additional headers

Important: Skip this step if you are using OWL Next with the Visual C++ .NET compiler.

Go to "c:\owl" and make the "c:\owl\include" subdirectory. Extract "add_fil.zip" into the subdirectory you just made. You want to place the three files ("commctrl.h", "htmlhelp.h", and "richedit.h") that this zip file contains in "c:\owl\include", so you'll have to override the path information that's saved in the zip file. You specifically do not want them to end up in the default "add_files" subdirectory that the zip file contains.

If you are using GNU tools, then extract "owl_lin.zip" and the zip files it contains. One of them is "gcc.zip" — you'll need that one — but the other one, "gnu_test.zip", contains examples that are optional. You could use the files contained in "gcc.zip" to overwrite the headers in your installation of "gcc", but I prefer to put them in their own directory and place that directory at the beginning of the include path. Here's what I do:

Step 3: Extract compatibility headers

If you are not using the compatibility headers ("compat.zip"), then you can skip this step.

But if you did decide to use the compatibility headers, then extract "compat.zip" into "c:\owl", making sure your extracting program respects the path information saved in the zip file. This will create the "c:\owl\compatibility" subdirectory. Move all the files in "c:\owl\compatibility\include\owl" to "c:\owl\include\owl", then move all the other remaining subdirectories of "c:\owl\compatibility\include" to become subdirectories of "c:\owl\include", and finally remove the "c:\owl\compatibility" directory.

If you are using BIDS, then make a subdirectory "c:\owl\lib" and extract the contents of "bids.zip" into that new directory.

Step 4: Patch to OWL Next 6.04

Extract "owl64x.zip" — x is the appropriate letter for your copy of OWL as described in the download section above — and "owlinst.zip" in "c:\owl", and run the extracted "owlinst" program.

Follow the patching procedure:

  1. A file open dialog pops up with the caption "Select patch file". Select "owl64x.owl", the file you just extracted.
  2. You see a "Welcome" message box that you can dismiss by clicking OK.
  3. Next you see a dialog captioned "Browse for Folder" that prompts you to "Select Borland C++ 5.02 root directory", if you're using "owl642.owl" as I am. Other patch files mention a different Borland compiler, of course. This dialog lets you specify where your original, unmodified Borland source can be found. The directory you want to specify is the one that has "source" and "include" subdirectories. In a default hard-disk installation of Borland C++ 5.02, that would be "c:\bc5", for instance. Tip: It's a very good idea to put your Borland CD into the CD drive and use that, because you know it's complete and unmodified. Many OWL Next installation difficulties are solved by using the CD here instead of a directory on your hard disk.
  4. Another "Browse for Folder" dialog appears, this time with the caption "Select directory for OWL". Use the "c:\owl" directory you created above.
  5. The patch program should now perform the patching. First it displays "BinPatch Licence Information", then it goes through a couple of progress dialogs. Finally, it says "Patch complete".

If at any time you see a file open dialog that is not described above, that means the patch program couldn't find some file it needed. The caption of this dialog tells you the name of the file it couldn't find. If this happens, and you are using a hard disk installation as your Borland root directory, then switch to the Borland CD, which should not have this problem. You should not proceed to the other steps until the source has been successfully patched.

If you look very closely at the progress dialogs, you may see error messages. For instance, I saw the message "owl642.utp is not valid archive" flash by, almost too quickly to read it. You can safely ignore these error messages.

Step 5: Patch to the latest version

Now that you have successfully installed OWL Next 6.04, you need to apply another patch to upgrade it to the latest version. Extract the lates patch into "c:\owl", then run program you just extracted. For instance, for version 6.19, extract "owl604p19.exe" from "owl604p19.zip", then run "owl604p19.exe". The patch program will run and hopefully report success.

Step 6: Extract optional files

If you are using "owlext30.zip", extract its contents into "c:\owl", making sure your extracting program respects the path information saved in the zip file.

If you are using "owlhlp.zip", make a subdirectory "c:\owl\help" and extract the zip file there.

Building

You may find easier to build OWL Next libraries using the OWLMaker program, which provides graphical user interface for choosing the libraries and setting various options. If so, download, install and run the program and use the wizard. If you don't want or can't use OWLMaker, then follow the steps below.

Step 1: Extract the build support files

Extract "obj32b.zip" or "obj32v.zip" in "c:\owl". Put the contents in the applicable directory, e.g. "\owlwfi" for a non-debug version.

Step 2: Select libraries

First, you need to decide what libraries you want. There are many possibilities, even with the unmodified Borland OWL. To see which ones you've installed, run this command:

dir \bc5\owl*.lib /s /p

I have nine Borland OWL libraries installed, and there are probably others on the CD.

You may not actually be using all the libraries you've installed. To see which you need for a particular project, first set "Options | Environment | Project View | Show run-time nodes" in the IDE, then load your project and look at each target node for lib files whose names begin with "owl". For instance, in one project, I have some nodes that use "owlwfi.lib", and some others that use "owldwfi.lib". So I need to build both of those.

To interpret those .lib names, break them down this way:

OWL [D] W [F|L|T] [I] [U]
OWL
means, well, OWL.
D
means debugging is enabled.
W
probably means windows.
F
means 32-bit flat model.
L
means 16-bit large model.
T
means multi-threaded.
I
means import library to accompany a DLL.
U
means Unicode.

Step 3: Modify the appropriate batch file

In "c:\owl\source\owlcore" there's a make file named "makefile" and batch files "gnuowl.bat", "bcowl.bat", and "mscowl.bat" that drive the make file. Choose the appropriate batch file for the compiler you plan to use, and take a look at its contents. You see many different examples to build various libraries. Remove the rem comment token from the ones you want, and insert rem before the ones you don't want, or make up your own.

Note: It may be better to edit a copy of the batch file, as the supplied batch files may be modified by a patch, and the patch program will fail if the file is modified.

Example

For example, here's what I did to build OWLWFI.LIB and its accompanying DLL:

c:\bc5\bin\make -c -K DLL=1 WIN32=1 -DOWLROOT=C:\OWL >make.out

I added "-K" to keep the temporary files created by make (useful for tracking down problems), and I redirected make's output to a file because I found it too taxing to try to read it as it scrolls by on the screen. The options I passed to the make file just say that I want to make the source in "c:\owl" into a 32-bit DLL.

Make file options

Here are the most important makefile options:

-DOWLROOT=C:\OWL
Always specify the location of your OWL Next source. If you don't, you get a default that you probably won't like.
DLL=1
Build a DLL instead of a static library. Omit this parameter to build a static library.
WIN32=1
Build a 32-bit library. [Does WIN16 work?]
ILINK=1
Use the incremental linker. Omit this parameter for BC++ version 5.02 or earlier, which have a buggy incremental linker.
DIAGS=2
Diagnostic build enables tracing information [Does the value 2 ever matter? Or is it just defined or not defined?]
DEBUG=2
Build library with full debug information. This lets you trace into OWL with the debugger, which can be very handy. But it also makes the library much larger; for that reason, Borland by default doesn't install debug builds, although they put them on the CD. [Does the value 2 ever matter? Or is it just defined or not defined?]
CODEGUARD=2
Build library with CodeGuard enabled. Omit this unless you have a reason to use CodeGuard on OWL itself. You can use CodeGuard on your own code and link it to a non-CodeGuard version of OWL.
-DCOMPILE_ASM
Use this only if you have TASM installed; otherwise, you'll get errors. If you don't use this parameter, you need to install the precompiled object files in "obj32b.zip" or "obj32v.zip".
-DOWLSECTION
This option is recommended. Many source files are separated into sections so that each section can be compiled into a separate object file. The linker uses only the sections your code needs, so that linking can be faster and your executable can be smaller for static builds. There is no drawback to using sectioning.
-D_USE_OWL_CM_EXIT
This is the correct value for Borland C++ 5.02. Borland C++ Builder and Borland C++ have conflicting definitions for CM_EXIT. If you are using Borland C++ Builder, instead use -D_USE_VCL_CM_EXIT.
-DBI_STD_RTL
[Is the purpose of this parameter only to recognize xalloc exceptions?]
-DBI_STD_STRING
This option is not recommended. It forces OWL to use the old non-ANSI string class in <cstring.h>. That means you cannot easily use a string class that conforms to the standard in your own code. But you may wish to use this parameter if your code depends on the old Borland class.

Step 4: Build selected libraries

Important: Make sure the file OWLROOT.INC contains correct path to the root of OWL Next

Run the batch file you just modified to build the selected libraries for OWL Next.

Further help and information

If you encounter any problems, please post them to the OWL Next mailing list (go to Subscribe/Unsubscribe/Preferences).