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:
LIB_CURL = {$IFDEF LINUX} 'libcurl.so' {$ELSE} 'libcurl-3.dll' {$ENDIF}; |
into this
LIB_CURL = {$IFDEF LINUX} 'libcurl.so' {$ELSE} 'libcurl.dll' {$ENDIF}; |
{$H+} {$IFDEF FPC} {$MODE OBJFPC} {$ENDIF} |
into this (notice that I only move the H+ directive)
{$IFDEF FPC} {$MODE OBJFPC} {$ENDIF} {$H+} |
SetResultCode(curl_easy_setopt(fCurl, CURLOPT_PROGRESSDATA, Self), CURLOPT_PROGRESSDATA); |
into this:
SetResultCode(curl_easy_setopt(fCurl, CURLOPT_PROGRESSDATA, pointer(Self)), CURLOPT_PROGRESSDATA); |
SetResultCode(curl_easy_setopt(fCurl, CURLOPT_DEBUGDATA, Self), CURLOPT_DEBUGDATA); |
into this:
SetResultCode(curl_easy_setopt(fCurl, CURLOPT_DEBUGDATA, pointer(Self)), CURLOPT_DEBUGDATA); |
SetResultCode(curl_easy_setopt(fCurl, CURLOPT_PRIVATE, self), CURLOPT_PRIVATE); |
into this:
SetResultCode(curl_easy_setopt(fCurl, CURLOPT_PRIVATE, pointer(self)), CURLOPT_PRIVATE); |
above steps had been tested on Lazarus 1.1, FPC 2.7.1 on Ubuntu Linux 12.04 and Windows 7
Hi, I get the following error…
lazcurl.pas(0,0) Fatal: Can not find unit LResources used by lazcurl. Check if package LCLBase is in the dependencies.