Go to the first, previous, next, last section, table of contents.


Compiling a Program with the DB Library

To compile the example program on a UNIX system, we can say:

cc -o psamples psamples.c -ldb

to produce an executable program called psamples. You may use any other compiler options you choose, but the `-ldb' option must appear in the cc command line following any and all source (`*.c') and object (`*.o') file names, in order to instruct the loader to search the DB library for any functions that the program needs (in this case, isigopen and getvec). Some programs will need additional libraries, and the corresponding `-l' options can usually be given before or after the `-ldb' option.

Each MS-DOS C or C++ compiler has its own idiosyncratic syntax, so no general rule can be given for MS-DOS. With Microsoft C/C++, use:

cl psamples.c -link db

With Borland C/C++, use:

bcc -LLIBDIR psamples.c db.lib

where LIBDIR is the directory in which `db.lib' (the DB library) has been installed. (Substitute `tcc' for `bcc' if you are using Turbo C or C++.) See your compiler manual for further information.


Go to the first, previous, next, last section, table of contents.



George B. Moody (george@hstbme.mit.edu)