Delphi: Support for Lazarus

The components can be used from within the Lazarus IDE on any platform (Windows, Linux, or Mac). To configure a Lazarus project to use our components follow the steps below.

Prerequisites

Windows: To use the components in Windows you need only install the Delphi edition of the toolkit.

Linux/Mac: In Linux and Mac you will need to copy the .pas files from a Delphi edition installation on a Windows machine.

You must also install the C++ Unix/Linux Edition of the toolkit on the non-windows machine. Navigate to the "src" folder of the installation and run the command:
sudo make install
It is important the libraries are installed to the /usr/lib directory so Lazarus can find them at runtime.

Configuration

  1. From the Project -> Project Options dialog, select the Compiler Options -> Paths section and enter the path to the "pas" folder of the /n software .pas files in the Other Unit Files textbox.

    This is the only required step for Windows.
  2. In Linux and Mac, you must also modify the linker options necessary for the C++ Unix/Linux edition. To do this, in the Project -> Project Options dialog select the Compiler Options -> Linking section and in the Options section specify:
    -lz -lresolv -lssl -lcrypto
    
    Be sure to check the "Pass Options To The Link" checkbox as well.
Note: In versions prior to V9 you must also define "LAZARUS". To do this, from the Project -> Project Options dialog, select the Compiler Options -> Other section and enter "-dLAZARUS" in the Custom options section.

Usage

In the source code for your project modify the uses statement to include the core, keys, and component pas files for the product and component you're using. For instance:

uses
  ipwcore, ipwkeys, ipwhttp ...
The names used in the uses statement correspond to the .pas files in the "pas" folder of the installation for the product. Below is an example of source code from a Lazarus project using the HTTP component from the IPWorks toolkit.

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

...

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');
...

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