Using the Delphi Edition with Lazarus
The Delphi edition components can be used in Lazarus projects on Windows, Linux, and macOS. The units in the pas folder of the installation detect the Free Pascal compiler automatically and switch to Delphi compatibility mode, so no changes to the source files are required.
When compiled with Free Pascal, the components call into the native library of the toolkit, which is included in the lib folder of the Delphi edition installation:
| Platform | Library | Location in the Installation |
|---|---|---|
| Windows (32-bit) | IPWorks26.dll | lib |
| Windows (64-bit) | IPWorks26.dll | lib64 |
| Linux (64-bit) | libipworks.so.26.0 | lib/linux |
| macOS (x64 and ARM64) | libipworks.26.0.dylib | lib/macos |
The file names above are for IPWorks 2026. Other products and versions follow the same pattern (e.g., the library for IPWorks SSH 2026 is IPWorksSSH26.dll on Windows).
Configuring the Project
The Delphi edition is installed on Windows. To build on Linux or macOS, copy the pas folder and the library for the target platform from a Windows installation to the build machine.
To configure a Lazarus project to use the components:
- Open Project > Project Options > Compiler Options > Paths.
- Add the path to the pas folder to the Other unit files (-Fu) field.
- Add the required units to the uses clause.
No linker options are required on any platform. On Windows, the application links to the library when it starts. On Linux and macOS, the library is loaded at runtime.
Example
The unit for each component is named after the component, with the ipw prefix (e.g., ipwhttp for the HTTP component).
uses
Classes, SysUtils, Forms, Controls, Dialogs, StdCtrls, ipwhttp;
procedure TForm1.Button1Click(Sender: TObject);
var
http: TipwHTTP;
begin
http := TipwHTTP.Create(nil);
try
http.Get('https://www.example.com/');
ShowMessage(http.TransferredData);
finally
http.Free;
end;
end;
Deploying the Application
The native library must be available to the application at runtime on every platform:
- Windows: Deploy IPWorks26.dll in the same folder as the application's executable. Use the 32-bit or 64-bit library to match the target of the application. Note that the installer also copies the library to the Windows system folders on the development machine, so a missing library may only be noticed when the application runs on another machine.
- Linux: Install libipworks.so.26.0 in a folder that the dynamic loader searches (e.g., /usr/lib or /usr/local/lib, followed by running ldconfig), or add its folder to the LD_LIBRARY_PATH environment variable.
- macOS: The library is loaded using the @rpath of the application, so the executable must have a runpath that includes the folder of the library. For example, to deploy the library alongside the executable, add -k-rpath -k@executable_path to the custom options of the project.
If the library cannot be found, the application fails to start on Windows, and on Linux and macOS, an error such as "IPWorks HTTP: Error creating component" occurs when a component is created.
Note that older versions of the toolkit required the LAZARUS symbol to be defined (using -dLAZARUS), and the C++ edition to be installed on Linux and macOS. In current versions, the units detect Lazarus automatically, and the Delphi edition includes the libraries for all supported platforms.
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.