You need an IBM AT compatible machine (386 and up) with a hard drive (5 MB free), and 2MB of RAM. This means that, basically, the configuration which is sufficient for your C or C++ compiler will be sufficient for our library. We assume that you have DOS 3.2 or higher.
Microsoft Visual C++ 4.0 or higher
Watcom C/C++ 10.0 or higher
ZORTECH C++ Ver.3.0 or higher
Borland C++ Ver.4.5 or higher
The library ships on a single 1.44MB(3.5") diskette. The installation procedure is simple. You insert the diskette and type:
A:
INSTALL
The installer will guide you through the installation procedure which takes just a few minutes.
If you get ERROR 2104, look at the instruction at Chap.2.6.
After you install the library, you have all the source files in place, but you have to compile them with the compiler you are planning to use. For most compilers, the scripts that recompile individual directories are already part of the library. In each directory, the README file tells you which script file to use.
In order to run with the library, you have to compile orgc and orgc\lib directories. Do not worry about directories orgc\macro, orgc\docum, and orgc\test, you may compile them later when considering some advanced uses of the library.
For example, in order to compile with Borland C++ 4.52 using the large memory model, you do this:
cd c:\orgc
make
cd lib
b4pmakel
In order to compile with Microsoft Visual C++ 4.0 or higher, enter the MS DOS window, and type this:
In order to use VC++ from the compile line (e.g. from the DOS window), the PATH and environment variables must be set properly. Without this, you will not be able to run the scripts that compile orgC++ and run the regression test. Most versions of Windows (and of the VC++ compilers) allow you to insert this information into the c:\autoexec.bat file. For example:cd c:\orgc
msft
cd lib
msft ... use msftd when debugging
Under some versions of Windows you can also set these variable by going to Control Pannel, System, Advanced, Environment Variables. Under WinXP this is the only way to do this:set MSDevDir=C:\PROGRA~1\MICROS~3\COMMON\MSDev98
set INCLUDE=C:\PROGRA~1\MICROS~3\VC98\INCLUDE
set LIB=C:\PROGRA~1\MICROS~3\VC98\LIB
set PATH=%PATH%;C:\PROGRA~1\MICROS~3\VC98\Bin;
C:\PROGRA~1\MICROS~3\COMMON\MSDev98\Bin
include = C:\Program Files\Microsoft Windows Studio\VC98\include
lib = C:\Program Files\Microsoft Windows Studio\VC98\lib
MSDevDir = C:\Program Files\Microsoft Windows Studio\Common\MSDev98
path = C:\Program Files\Microsoft Windows Studio\VC98\bin
For more details on how to run under Microsoft Visual C++, see Chap.2.5.
Note that all script files automatically use appropriate environment files (see Chap.5 ); also the important file orgc/zzcomb.h is automatically generated during the process.
If the compiler which you are planning to use is not listed in the README files, contact Code Farms. We will help you to customize one of the existing script files and to create your own environment file.
After you install the software, test it as shown in the second half of Chap.5.
OrgC++ runs on a variety of hardware. On a SUN3 or SUN4 you load the streamer tape in the following way:
mkdir orgC
cd orgC
tar -xvf /dev/rst8
On other machines, only the device is different:
| SUN3 | rst8 |
| SUN4 | rst8 |
| HP9000 | rct |
| Masscomp | rctp |
| Sony News | rtu00 |
When you un-tar the tape, the entire library is already compiled for SUN OS4.1 (SPARC), regular SUN C and the Sun C++ Ver.2.0. If you run with a different compiler (or a newer version of the C++ compiler), you have to recompile the library. Script files are provided for the most frequently occuring combinations.
When using the SUN C and C++ compilers, replace the line #define SUN in files orgc/lib/env*s.h as follows. It does not matter whether you run under SUN OS or under Solaris:
#define SUN ... for C++ Ver.2.0
#define SUN2_1 ... for C++ Ver.2.1
#define SUN3_0 ... for C++ Ver.3.0 or higher
Then type this:
cd orgc
jsmake
cd lib
jscmake
When using the GNU compiler, type this:
cd orgc
jsgmake
cd lib
jsgmake
When running with Silicon Graphics computer, type this:
cd orgc
jssgmake
cd lib
jssgmake
These runs also re-generate important file orgc/zzcomb.h. Script files for HP, AIX, and other UNIX environments are listed in the README files. If you cannot find your platform/compiler combination in the README file, you will have to set up your special script files and the environ.h file. Call Code Farms, and we will help you to modify one of the existing files.
When you begin to use the library, there is no need to recompile in directories orgc/docum and orgc/macro. If, later on, you need programs stored in these directories, invoke the script files as indicated in the README files. For example, in order to recompile these directories with the SUN compiler, type:
cd orgc/macro
jsmake
cd orgc/docum
jsmake
Today, relatively few workstations are equipped with a tape drive. Many SUN users load new software from 3.5" diskettes or using ftp over the network. If you opted for 3.5" diskettes instead of the tape, you received several diskettes that contain the full source, which is not compacted, and is organized in several subdirectories. Copy the entire directory tree onto your hard disk.
After you install the software, test it as shown in the second half of Chap.5.
Download the tar file via ftp, or install the DOS diskette (make sure the files are treated as UNIX and not DOS files). The environment and compilation is same as for SUN/GNU combination, but the ready to use batch files are slightly different for LINUX:
lgmake
cd lib
lgmake
cd ../test
lgregr
The OrgC++ library is distributed on DOS diskettes, and you need either a Macintosh that can read DOS diskettes, or you must transfer the library over a network. In either case, you must recompile the library. The following sequence assumes that you installed the library under the root directory called orgc:
(1) directory :orgc
immake
zzcomb
(2) directory :lib
jmmake ......(for the C version of the library), or
jmcmake .....(for the C++ version of the library).
If you get to this point without errors, you are ready to run. The remaining steps are only for the auxiliary functions (documentation and library updates):
(3) directory :macro
jmmake
(4) directory :docum
jmmake
After you install the software, test it as shown in the second half of Chap.5.
Enter the MS-DOS Command Prompt , and install, compile, and test the library using the appropriate script files as shown in Chap. 2.1. There is no need (and it is actually more complicated) to do this in the visual environment.
Some programmers use the Windows enviroment for better memory management. You should be aware that all allocation in the Code Farms library is channelled through a single call to malloc() or calloc(), see file lib\msgs.c. The new() operator is overloaded by a call to this function. The purpose of this arrangement is to provide entry for private allocation schemes.
If you don't make any special arrangements for memory allocation, you may be limited by the Windows memory management scheme. Windows puts an upper limit on the number of "handles" that can be allocated (approximately 8k). Depending on how your compiler implements malloc() etc., you may not be able to create more than 8k objects!!
There are three ways to overcome this limitation:
(1) Change the calls to malloc(), calloc(), realloc(), and free() in file lib\msgs.c to the Windows allocation functions (GlobalAlloc() etc.).
(2) Code your own version of malloc(), calloc(), realloc(), and free(), using Windows allocation functions (GlobalAlloc()). Then link these functions before Borland's or other library.
(3) Use a commercial memory allocator like SmartHeap from MicroQuill Corp (tel 206-535-8218), and link it again before Borland's library. The package provides replacement for malloc(), calloc(), realloc(), free(), new(), and delete() with essentially no limitations. Note that since the OrgC++ library also overloads operators new() and delete(), it is essential that you link the OrgC++ library first, then the commercial allocator, and then Borland's or other library.
If you use Visual C++ from Microsoft Corp., your entire environment is driven by menu items and graphical displays, and is subject to unusual restrictions not present in other compilers. Visual C++ is not a normal compiler, but rather a windows developement framework. The following items are important when using the Code Farms library with Visual C++:
ITEM 1: Make sure that autoexec.bat includes correct PATH, INCLUDE, and LIB statements:
PATH .......;C:\msdev\bin
SET INCLUDE=c:\msdev\include
SET LIB=c:\orgc\lib;c:\msdev\lib
ITEM 2: The compilation is the same, whether you run under Win3.1, Win95, or WinNT. The only difference is that, for Win 3.1 or Win95, you have to remove line
#define NT
from the file c:\orgc\lib\envmsft.h.
Compiling the library in the DOS window:
cd c:\orgc
msft
cd lib
msft
When using the VC++ debugger, all parts of the code must be compiled with the /Debug option. While debugging, compile orgC++ with lib\msftd.bat instead of lib\msft.bat.
When using the library, copy the environment file into your current directory:
cd ....\mydir
copy c:\orgc\lib\envmsft.h environ.h
In order to run the regression test:
cd c:\orgc\test
msftregr
ITEM 3: When running Visual C++ in the debugging mode (this is the most usual mode when developing new software), the compiler replaces the new() operator by an operator DEBUG_NEW. This happens for all classes that Class Wizard generated automatically for you. Since the Code Farm library always overloads operator new(), this results in a collision and compilation errors. In order to prevent this, comment the following line
#define new DEBUG_NEW
in all files generated by Microsoft that also use any classes registered under the Code Farm's library (classes that have ZZ_EXT_... ). This disables the automatic memory leak detection provided by Visual C++, but there will be no conflict with the Code Farm's library.
ITEM 4: In Visual C++, the standard C preprocessor does not always behave as you would expect. In particular, #define and #include statements before and after #include "stdafx.h" have a different effect if you are using pre-compiled headers. Make sure that all the library defines and includes are after this statement.
#include "stdafx.h"
....
#define ZZmain
#include "zzincl.h"
#include "zzfunc.c"
ITEM 5: When you link your aplication, you may get warnings about mllib.lib not being compatible with VC++ runtime library. If this happens make sure that you compile the Code Farm's library with the same switches as your application.
BUILD - SETTINGS - C/C++: disable precompiled headers
BUILD - SETTINGS - LINK: add c:\orgc\lib\mllib.lib at the end
BUILD - SETTINGS - LINK: use /nodefaultlib:"libc.lib"
TOOLS - DIRECTORIES: add c:\orgc\lib
OPTIONS - DIRECTORIES: add c:\orgc and the directory of zzincl.h
Install and test the library using the same script files as for DOS, referring to the compiler you use (for example Borland).
No special script files are required.
The DOS version of the library uses a third party installation package, used by many other companies in the software industry. Some earlier versions of this software, when aborted in some irregular way, for example by rebooting the computer, left behind a working directory with one or more temporary files. On the next attempt to install the software, the installer stops with error 2104. This working directory may have been left on your disk by some other software which you tried to install sometime in the past.
In order to correct this situation, remove directory ISFYZQVO.TWJ and all the files that are in it. After that you will be able to install the library as expected.
| Chapter 3: Software Key |