Building Programs

For Legacy verions of C batch files are supplied for compiling and linking programs. These are described here.

If you are using Microsoft Visual C++ on any Win32 platform you can build your programs using a Visual Studio project - but in this case you must be careful that the compiler options selected are suitable. In particular you should specify the Zp1 option, or else use #pragama pack(1) round the include files generated by LIBMAKE LIBMAKE did not generate the necessary pragmas itself until 4.620. You should also check that WIN32 is defined (it almost certainly will be). We have never been able to persuade Visual Studio to run LIBMAKE as part of the build process, though probably we just didn't try hard enough.

Simple DP4 programs can be built directly with the compiler on most platforms, for example on Win9x you can use the following command line to a build a single module program:

cl -DWIN32 -Zp1 -Oxs progname.c -link ntown.lib -entry:mainCRTStartup
The -Oxs option is usually the best choice of optimisation flags for any program. To build a debug version of your program use -Od -Zi instead.

On Unix or Linux you would use something like:

$(CC) -o progname $(CFLAGS) progname.c ccown.a

This assumes that CC and CFLAGS are environment variables that are appropriately defined, for example CC=cc or CC=gcc and CFLAGS=-Dunix -O2 -I.

A very good way to build programs on any platform is using make files. A simple template make file that works with Microsoft NMAKE for building DP4 Windows programs, dp4c.mak, is included on the CD ROM. It is also not too difficult to develop a cross platform make file that will work anywhere. Most of DP4 is built like this. We will gladly send you sample make files on request, but as DP4 is or has been built for around twenty different platforms, you may find them over-complicated for your needs.