Support for Lazarus in Delphi Edition


The IPWorks components can be used within the Lazarus environment on Windows, Linux, and Mac. This article explains how to configure a Lazarus project and integrate the components across platforms.

Prerequisites

  1. On Windows, install the Delphi edition of the toolkit. No additional setup is required.
  2. On Linux/Mac, copy the .pas files from a Windows Delphi installation and install the C++ Unix/Linux edition. Then navigate to the src directory and run:
sudo make install

Ensure libraries are installed in /usr/lib so Lazarus can locate them at runtime.

Configuration

  1. Open Project -> Project Options -> Compiler Options -> Paths and add the path to the pas folder in the Other Unit Files field. This is the only required step on Windows.
  2. On Linux and Mac, also configure linker options under: Compiler Options -> Linking and then enable Pass Options To The Linker.
-lz -lresolv -lssl -lcrypto

Note In versions prior to V9, define LAZARUS by adding -dLAZARUS under Compiler Options -> Other.

Usage

Add the required units in the uses clause of your Lazarus project. Example:

uses 
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, 
StdCtrls, ipwcore, ipwkeys, ipwhttp; 

These unit names correspond to the .pas files provided in the installation.

Example

procedure TForm1.Button1Click(Sender: TObject); 
var 
MyHTTP: TipwHTTP; // Declare an instance of the component 
begin 
MyHTTP := TipwHTTP.Create(self); // Create the instance of the component 
MyHTTP.Get('http://www.google.com'); 
end;

We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.