Vocabularyalien.librariesInputs and outputsWord descriptionDefines a new logical library named
name located in the file system at
path and the specified ABI. The logical library name can then be used by a
LIBRARY: form to specify the logical library for subsequent
FUNCTION: definitions.
NotesBecause the entire source file is parsed before top-level forms are executed,
add-library must be placed within a
<< ... >> parse-time evaluation block.
This ensures that if the logical library is later used in the same file, for example by a
FUNCTION: definition. Otherwise, the
add-library call will happen too late, after compilation, and the C function calls will not refer to the correct library.
For details about parse-time evaluation, see
Parse time evaluation.
ExamplesHere is a typical usage of
add-library:
<< "freetype" {
{ [ os macosx? ] [ "libfreetype.6.dylib" cdecl add-library ] }
{ [ os windows? ] [ "freetype6.dll" cdecl add-library ] }
[ drop ]
} cond >>
Note the parse time evaluation with
<<.
Definition