---
product: Chilkat
product_version: 11.7.0
language: pascal
language_label: Lazarus Pascal
document: language guide
---
> Chilkat 11.7.0 · language=pascal · this file: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/pascal/guide.md`
> Class pages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/pascal/classes/<Class>.md`

# Chilkat for Lazarus Pascal — language guide — v11.7.0

## 1. Which Chilkat binding this is

This is the **Chilkat library for Lazarus / Free Pascal**: real Object Pascal classes (`THttp`, `TZip`, `TBinData`, … — `T` + the generic class name) in units that also compile in Delphi XE2+. Objects are created with `THttp.Create` (check `IsValid` afterwards) and freed with `Free`; properties are Pascal properties; string results are Pascal strings. Distinct from the Delphi DLL binding (handle/function API) and the Delphi ActiveX binding.

## 2. Install and requirements

Download from [https://www.chilkatsoft.com/lazarus.asp](https://www.chilkatsoft.com/lazarus.asp): add the units to the project's unit path and the native library for the platform (Windows, Linux, macOS).

## 3. Unlocking, object creation, lifetime and errors

Generated from the reference documentation for this binding:

**Create / Free**

```pascal
uses
  Chilkat.Global;

var
  obj: TGlobal;
begin
  obj := TGlobal.Create;
  try
    if not obj.IsValid then
      raise Exception.Create('Failed to create a TGlobal instance.');

    // ... use obj ...

  finally
    obj.Free;
  end;
end;
```

`constructor Create;`

Allocates the underlying CkGlobal object and returns a new TGlobal instance. Simply adding **Chilkat.Global** to the unit's `uses` clause is enough to locate and bind to the Chilkat shared library (DLL / .so / .dylib) at runtime — no separate load step is required. Check `obj.IsValid` after calling `Create`; it is `False` if the underlying library could not be found/loaded or the object could not be allocated (for example, when unlicensed).

`destructor Destroy; override;`

Every TGlobal created by calling `Create` should eventually be released by calling `.Free` (inherited from `TObject`). The destructor automatically disposes the underlying CkGlobal handle. A native (unmanaged) memory leak occurs if the object is never freed.

## 4. Error model

Methods **do not raise exceptions** for Chilkat-level failures. The note under each method on the class page says how it reports failure: a `Boolean` status method returns `False`; for string results check `LastMethodSuccess`; object-returning methods return `nil`; `LastErrorText` holds the diagnostic in every case. `IsValid` is `False` after `Create` if the shared library could not be loaded.

Literals in Lazarus Pascal: true is `True`, false is `False`, null/none is `nil`.

## 5. Strings, bytes and encodings

- Strings are Pascal `string` (UTF-8 in Lazarus); a `charset` argument names the encoding of the *bytes* being produced or read.
- Binary data goes through `TBinData` (`Bd` methods) and `TBytes`; text through `TStringBuilder` (`Sb` methods).
- Methods with `2`/`3` suffixes or `Quick*` prefixes are distinct members, not overloads.

## 6. Object lifetime and threading

Objects are freed with `Free` (or `FreeAndNil`), including objects returned by methods, which the caller owns.

A Chilkat object may be used from any thread, but **one object must not be used by two threads at the same time**: create one object per thread or protect it with a lock. Objects are independent — there is no shared global state other than the unlock flag and the few `Global` settings.

## 7. Progress callbacks and async

Progress events are supported through the class's event properties (see the "Events and callbacks" section of a class page). Every call is synchronous.

## 8. Common mistakes an AI makes with this binding

1. Writing Delphi DLL handle code (`CkHttp_Create`, `CkHttp_QuickGetStr(h, …)`) or `TCkHttp` against the Pascal classes — here they are `THttp`, `TZip`, ….
2. Forgetting to `Free` objects returned by methods.
3. Omitting `Global.UnlockBundle` (the program runs in trial mode and stops working after 30 days).
4. Inventing members by analogy with other libraries. If a member is not on the class page, it does not exist — look it up rather than guessing.
5. Using deprecated members that older examples still show. The class page lists each one with its replacement; `deprecated.md` lists them all.
6. Ignoring the failure path. Every Chilkat method reports failure (see each method's note); `LastErrorText` says why, and printing it is the first debugging step.
7. Using one Chilkat object from two threads at the same time. Create one object per thread, or protect it with a lock.

## 9. Instructions block for coding agents

Paste into `CLAUDE.md`, `.cursor/rules`, or Copilot instructions:

```
This project uses Chilkat 11.7.0 from Lazarus / Free Pascal (Object Pascal classes THttp, TZip, ... = T + class name).
- Reference: https://www.chilkatsoft.com/ai-docs/v/11.7.0/pascal/ — read guide.md once, then classes/<Class>.md for each class used.
- Create a TGlobal and call UnlockBundle(...) once at startup; check IsValid after Create; Free every object.
- Methods never raise: check the False/empty/nil result and write LastErrorText.
- Never use a member that is not on the class page; never use members listed as deprecated.
```

## 10. Classes

[Class index for Lazarus Pascal](https://www.chilkatsoft.com/ai-docs/v/11.7.0/pascal/index.md)
