|
Libraries |
Top Previous Next |
|
A project defines a set of files that can be built into an executable application. In a similar way, you can define a set of files that can be built into an object library. The resulting library can then be used when building applications.
Creating a library You create a library by right-clicking a task or a processor in the Diamond source view. Creating a library on a task makes it local to that task; creating it on a processor makes the library global to all the tasks of the processor.
Having created a library, you can insert files by right-clicking and either creating a new file (Create file) or copying-in one or more existing file from somewhere else (Add existing files).
Using libraries A library that is local to a task is included in the build commands for that task. It is common for a library to have a header file that defines an interface for all the accessible objects within the library, and you can select one of the files inside the library, usually a header file, to be that interface. When you put a library into a task, any source file with the same name as the task automatically is given a reference to the interface file. Other files in the task can be given references to the interface file by dropping either the interface file itself or the whole library onto those files. You make a file an interface file by right-clicking it and choosing Select as interface. The icon for the file is modified by the addition of a small 'i'. Dragging a library that is global to the tasks on a processor onto one of those tasks moves the library into the task and makes it local. If you want to include a reference to the global library in a task, you should press both Shift and Control before dropping the library onto the task.
|