[fpc-devel] library export in Linux

ABorka fpc-devel at aborka.com
Fri Oct 3 03:14:53 CEST 2008


Thanks, Jonas.

Any suggestion why apache 2.2.8 does not want to load the FPC compiled 
apache modules (ex: mod_hello.pp in packages/httpd2/examples) on Linux?

.
.snip
.
{$define Apache2_2}
uses SysUtils, httpd {$ifndef Apache1_3}, apr{$endif};

var
  test_module: module; public name 'test_module';

{*******************************************************************
*  Free Pascal only supports exporting variables on Windows
*******************************************************************}
{$ifdef WINDOWS}
exports
  test_module name 'test_module';
{$endif}
.
.snip
.
begin
   default_module_ptr := @test_module;
   FillChar(default_module_ptr^, SizeOf(default_module_ptr^), 0);
     STANDARD20_MODULE_STUFF(test_module);

     with test_module do
     begin
       name := MODULE_NAME;
       register_hooks := @RegisterHooks;
     end;
end.

does not work ("Can't locate API module structure").
The length of module_struct (module = module_struct) is correct compared 
to the C compiled working apache modules.
Did these example programs work before fpc supported "exports test_module"?


Jonas Maebe wrote:
 >
 > On 28 Sep 2008, at 10:15, ABorka wrote:
 >
 >> Is the "exports" now supported in Linux or it's a glitch that apache 
loads the modules with the exports in them?
 >
 > It is now supported, as long as the "exports" name is the same as the 
original variable's name.
 >
 >
 > Jonas
 > _______________________________________________
 > fpc-devel maillist  -  fpc-devel at lists.freepascal.org
 > http://lists.freepascal.org/mailman/listinfo/fpc-devel
 >



Jonas Maebe wrote:
> 
> On 28 Sep 2008, at 10:15, ABorka wrote:
> 
>> Is the "exports" now supported in Linux or it's a glitch that apache 
>> loads the modules with the exports in them?
> 
> It is now supported, as long as the "exports" name is the same as the 
> original variable's name.
> 
> 
> Jonas
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> 




More information about the fpc-devel mailing list