Article View: pl.comp.lang.pascal
Article #92359[Lazarus] Instalacja komponentu CurlPas
From: Terrmit
Date: Mon, 31 Dec 2007 22:33
Date: Mon, 31 Dec 2007 22:33
64 lines
3801 bytes
3801 bytes
Witam,
Trochę pomęczyłem instalację CurlPas w Lazarusie, więc
chciałem podzielić się swoimi doświadczeniami.
Komponent pobrałem z:
http://sourceforge.net/project/showfiles.php?group_id=150871
Niestety ostatnia wersja jest z dnia 05.11.2005, a więc dość leciwa.
Podczas instalacji pakietu w lazarusie trzeba dodać wymóg LCL,
gdyż inaczej woła o LResources:
Can't find unit LResources
potem przy kompilacji wywala jeszcze błędy:
<errors>
ocurlacc.inc(24,20) Error: Illegal type conversion: "ShortString" to "^Char"
ocurlacc.inc(24,45) Warning: Local variable "R" does not seem to be
initialized
ocurlacc.inc(24,78) Error: Illegal type conversion: "ShortString" to "^Char"
ocurlacc.inc(32,14) Error: Illegal type conversion: "ShortString" to "^Char"
ocurlacc.inc(32,63) Warning: Local variable "R" does not seem to be
initialized
ocurlacc.inc(42,16) Error: Illegal type conversion: "ShortString" to "^Char"
ocurlacc.inc(43,19) Warning: Local variable "R" does not seem to be
initialized
ocurlacc.inc(43,52) Error: Illegal type conversion: "ShortString" to "^Char"
ocurlacc.inc(45,19) Error: Illegal type conversion: "ShortString" to "^Char"
ocurlacc.inc(47,23) Error: Illegal type conversion: "ShortString" to "^Char"
ocurlacc.inc(47,81) Error: Illegal type conversion: "ShortString" to "^Char"
ocurlcll.inc(27,37) Error: Illegal type conversion: "ShortString" to "^Char"
ocurlcll.inc(31,17) Error: Illegal type conversion: "ShortString" to "^Char"
ocurlcll.inc(132,22) Error: Illegal type conversion: "ShortString" to
"^Char"
ocurlcb2.inc(30,69) Error: Wrong type "TCurl" in array constructor
ocurlcb2.inc(93,65) Error: Wrong type "TCurl" in array constructor
ocurlcb2.inc(164,26) Error: Illegal type conversion: "ShortString" to
"^Char"
ocurlset.inc(11,64) Error: Illegal type conversion: "ShortString" to "^Char"
ocurlset.inc(19,21) Error: Illegal type conversion: "ShortString" to "^Char"
ocurlget.inc(8,24) Error: Call by var for arg no. 1 has to match
exactly: Got "ShortString" expected "WideString"
</errors>
Z błędami Illegal type conversion: "ShortString" to "^Char"
można sobie poradzić dopisując dyrektywę:
{$IFDEF FPC}{$mode objfpc}{$H+}{$ENDIF}
na początku pliku ocurlacc.inc.
Błąd Wrong type "TCurl" in array constructor
występuje np. w linii:
SetResultCode(curl_easy_setopt(fCurl, CURLOPT_PROGRESSDATA, Self),
CURLOPT_PROGRESSDATA);
Odnosi się on do słowa Self.
Zamieniamy w funkcjach curl_easy_setopt słowo Self na Pointer(Self)
w pliku ocurlcb2.inc oraz ocurlini.inc (w sumie 3 miejsca)
Teraz kompilacja pakietu powinna się udać. Po zainstalowaniu komponentu
polecam uruchomić demo curldemo.lpi znajdujące się w katalogu /gui/
W komponencie memo powinien pojawić się tekst dokumentu ze wskazanej
strony.
Pozdrawiam,
Sławek
P.S. Instalacja robiona była w Lazarusie 0.9.25 beta SVN Revision: 13549
FreePascal 2.2.0-0, Libcurl-7.17.1-1, w systemie Fedora 8.
Technical Details
Message-ID:
<flbr0q$27o$1@atlantis.news.tpi.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!newsfeed.tpinternet.pl!nemesis.news.tpi.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!newsfeed.tpinternet.pl!nemesis.news.tpi.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: Terrmit <terrmitv@poczta.onet.pl> Newsgroups: pl.comp.lang.pascal Subject: [Lazarus] Instalacja komponentu CurlPas Date: Mon, 31 Dec 2007 23:33:37 +0100 Organization: tp.internet - http://www.tpi.pl/ Lines: 64 Message-ID: <flbr0q$27o$1@atlantis.news.tpi.pl> NNTP-Posting-Host: fge166.internetdsl.tpnet.pl Mime-Version: 1.0 X-Trace: atlantis.news.tpi.pl 1199140698 2296 83.13.160.166 (31 Dec 2007 22:38:18 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Mon, 31 Dec 2007 22:38:18 +0000 (UTC) User-Agent: Thunderbird 2.0.0.9 (X11/20071115) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit