[fpc-devel] library export in Linux

ABorka fpc-devel at aborka.com
Sun Oct 5 08:02:58 CEST 2008


Hi Felipe,

The problem is only there (checked now on apache 2.2.3 also with the 
latest svn fpc /11864/ and lazarus /16875/ trunk) if

{$ifdef WINDOWS}//!! not needed
exports test_module name 'test_module1';
{$endif}        //!! not needed

is there. If the ifdef is removed and the exports instruction is there, 
then apache loads the module without any errors on Linux.

An additional problem for me was that I've used a procedure to write to 
a log file for debugging purposes. It is working on Windows but on Linux 
it somehow puts the apache module execution into a black hole after it 
is called within the defaulthandler function (it is ok if it is called 
in the initialization section or in the RegisterHooks procedure):

procedure WriteToLogFile(MessageStr:String);
var f: textfile; LogFile:String;
begin
   LogFile := '/HTTPDebugLogFile.log';
   assignfile(f, LogFile);
   if not FileExists(LogFile) then ReWrite(f)
                              else Append(f);
   writeln(f, FormatDateTime('yyyy/mm/dd hh:mm:ss.zzz', Now) + ':' + 
MessageStr);
   closefile(f);
end;

If the assignfile is called, it already screws the DefaultHandler 
execution even if the lines after it are commented out in the procedure.
Any suggestion why? I've tried to use streams, same result.

AB


Felipe Monteiro de Carvalho wrote:
> Ok, I go back to my previous idea. Test it with an older apache
> (specially good would be 2.2.3).
> 




More information about the fpc-devel mailing list