Tag Archives: curlpas

Fixing curlpas so it would compile and install in latest Lazarus/FreePascal

What is curlpas? (Taken from the official web)

CurlPas is a Delphi / Kylix / FreePascal binding and component wrapper for libcurl .

Curlpas had so many features that other internet LCL didn’t have. Such as: multi-platform, non-blocking, proxy support, SSL support, byte ranges, multiple asynchronous transfers. The most exiting part for me is that curlpas make it easier for me to understand internet/network programming (I use curl a lot in my PHP projects).

The problem is that curlpas is so old (dated 2005) and haven’t updated to reflect latest change in Lazarus IDE and FPC. So, when you try to compile it, you’ll get a lot of error messages mostly about PChar, AnsiString, WideString and Pointer. (I forgot the exact error messages).

In order to fix those errors, you have to:

  • edit file curl_h.pas line #29, from this

into this

  • edit file ocurluse.inc line #6 until #9 from this

into this (notice that I only move the H+ directive)

  • edit file ocurlcb2.inc on line #30 from

into this:

  • and still in ocurlcb2.inc but on line #93 from

into this:

  • and the last one to edit is ocurlini.inc line #125, from:

into this:

  • save all, compile and install on your Lazarus IDE, cURL should be shown in Lazarus component palette named “Internet”

above steps had been tested on Lazarus 1.1, FPC 2.7.1 on Ubuntu Linux 12.04 and Windows 7