Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - default libraries are specified in special object module records. library http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Default libraries are specified in special object module records.  Library
names are extracted from these special records by the Watcom Linker.  When
unresolved references remain after processing all object modules specified
in linker "FILE" directives, these default libraries are searched after all
libraries specified in linker "LIBRARY" directives have been searched.

By default, that is if no library pragma is specified, the Watcom C/C++
compiler generates, in the object file defining the main program, default
libraries corresponding to the memory model and floating-point model used to
compile the file.  For example, if you have compiled the source file
containing the main program for the medium memory model and the
floating-point calls floating-point model, the libraries "clibm" and "mathm"
will be placed in the object file.

If you wish to add your own default libraries to this list, you can do so
with a library pragma.  Consider the following example.


     #pragma library (mylib);

The name "mylib" will be added to the list of default libraries specified in
the object file.

If the library specification contains characters such as '\', ':' or ','
(i.e., any character not allowed in a C identifier), you must enclose it in
double quotes as in the following example.


     #pragma library ("\watcom\lib286\dos\graph.lib");
     #pragma library ("\watcom\lib386\dos\graph.lib");

If you wish to specify more than one library in a library pragma you must
separate them with spaces as in the following example.


     #pragma library (mylib "\watcom\lib286\dos\graph.lib");
     #pragma library (mylib "\watcom\lib386\dos\graph.lib");

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson