[fpc-pascal] freepascal and apache

Michael Van Canneyt michael at freepascal.org
Wed Oct 7 09:31:26 CEST 2009



On Wed, 7 Oct 2009, Alexey Voytsehovich wrote:

> Hello Michael,
>
> Wednesday, October 7, 2009, 10:13:08 AM, you wrote:
>
>
>> On the command-line, define one of FPCAPACHE_2_0 or FPCAPACHE_2_2 (as in -dFPCAPACHE_2_0)
>> (or delete the units in units/httpd-1.3)
>
> build string
> fpc -dFPCAPACHE_2_2 mod_hello.pp
> all unit code
> --
>
> library mod_hello;
> {$ifdef fpc}
>  {$mode objfpc}{$H+}
> {$endif}
>
> {$IFDEF WIN32}
>  {$DEFINE WINDOWS}
> {$ENDIF}
>
> {$define Apache2_2}
> {$define FPCAPACHE_2_2}
>
> uses SysUtils, httpd;
>
> function read_Post(r: Prequest_rec; data: string): boolean;
> var
>  types: string;
> begin
>  Result := True;
>  if (r^.method_number <> M_POST) then
>    Exit;
>  ap_set_content_type(r, 'text/html');
>  types := ap_table_get(r^.headers_in, 'Content-Type');
> end;
>
> begin
> end.
>
> --
>
> mod_hello.pp(23,24) Error: Identifier not found "ap_table_get"

Correct, because the function is called apr_table_get (note the r), 
and is located in unit apr, not in httpd.

Michael.



More information about the fpc-pascal mailing list