Sign in Join
Wiki copytemporary

Library path: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Library path

OldNewLine
1+Q: Where do I add the path for source of 3rd party components? In Delphi it was in the "Library path".
2+
3+Answer 1, from forum member **wp**:
4+
5+Lazarus is very different from Delphi regarding the path to 3rd party units.
6+
7+3rd party units come to you in [[packages]] (extension .lpk). In order to use a 3rd party unit in a project you add the corresponding package to the requirements of the project: Open "Project" \> "[[IDE Window: Project Inspector|Project inspector]]". Click "Add" \> "New requirement" and select the package from the list \> "OK". Now the package appears in the lower part of the list in the project inspector ("Required packages"), and the IDE knows where to find the units contained in the package so that you can add any unit contained in the package to the `uses` clause.
8+
9+If the 3rd-party component is "installed" (normally: if there is an icon in the [[Component Palette]]) simply drop the component on the form and the project is automatically extended by the related package (and the unit is added to the `uses` clause of the form).
10+
11+Unless you really know what you are doing you should never extend the unit path ("Other unit files" in the project inspector) by the path to 3rd party components - it is easy to create lots of compilation issues if you do this.
12+
13+Answer 2, from forum member **trev**:
14+
15+"3rd party units come to you in packages." - Not necessarily: some do, many do not especially if they're not Lazarus-specific or not visual components. Installation can be as simple as copying over all files to your application directory and adding the relevant units to your uses clause. Alternatively, Lazarus provides "Project \> Project Options \> Compiler Options \> Paths - Other unit files".
16+
17+---
18+*From the Free Pascal wiki, page "Library path", as it stood on 2022-03-22 after a change by Alextp, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
19+Category: Packages

Back to history