[Lazarus] unit system in
William Oliveira Ferreira
bdexterholland at gmail.com
Wed Jan 18 14:08:49 CET 2012
i was writing my first FastCGI application and on building, i've got this
error:
C:\lazarus\packager\registration\fcllaz.pas(1,1) Fatal: Can't find unit
system used by fcllaz
my source:
unit unt_principal;
{$mode objfpc}{$H+}
interface
uses
SysUtils, Classes, httpdefs, fpHTTP, fpWeb, mysql51conn, sqldb;
type
{ TgetDBUpdates }
TgetDBUpdates = class(TFPWebModule)
dbConnection: TMySQL51Connection;
Transaction: TSQLTransaction;
sql_Query: TSQLQuery;
procedure DataModuleRequest(Sender: TObject; ARequest: TRequest;
AResponse: TResponse; var Handled: Boolean);
private
{ private declarations }
function GetDBScripts(const UserVersion : String; const UserSystem :
String) : String;
function ValidarDados(const UserVersion : String; const UserSystem :
String) : Boolean;
public
{ public declarations }
end;
var
getDBUpdates: TgetDBUpdates;
implementation
{$R *.lfm}
{ TgetDBUpdates }
procedure TgetDBUpdates.DataModuleRequest(Sender: TObject; ARequest:
TRequest; AResponse: TResponse; var Handled: Boolean);
var
UserVersion : String;
UserSystem : String;
begin
AResponse.ContentType := 'text/sql;charset=latin1;';
UserVersion := ARequest.QueryFields.Values['userversion'];
UserSystem := ARequest.QueryFields.Values['usersystem'];
if ValidarDados(UserVersion, UserSystem) = True Then
AResponse.Contents.Text := GetDBScripts(UserVersion, UserSystem);
Handled := True;
end;
function TgetDBUpdates.GetDBScripts(const UserVersion: String; const
UserSystem : String): String;
begin
Result := EmptyStr;
try
sql_Query.SQL.Add('SELECT upd_script FROM dbu_scripts WHERE upd_sistema =
:UserSystem AND upd_versao > :UserVerion');
sql_Query.ParamByName('UserVersion').AsString := UserVersion;
sql_Query.ParamByName('UserSystem').AsString := UserSystem;
sql_Query.Open;
sql_Query.First;
while not sql_Query.EOF do
Result := Result + sql_Query.FieldByName('upd_script').AsString;
except
Result := '[ERROR]';
end;
end;
function TgetDBUpdates.ValidarDados(const UserVersion: String;
const UserSystem: String): Boolean;
begin
Result := True;
end;
initialization
RegisterHTTPModule('TFPWebModule1', TgetDBUpdates);
end.
but the point is: why fpc raised that error if the fcllaz.pas doesn't
directly import that unit?
{ This file was automatically created by Lazarus. Do not edit!
This source is only used to compile and install the package.
}
unit fcllaz;
interface
uses
RegisterFCL, db, process, simpleipc, eventlog, XMLConf, LazarusPackageIntf;
implementation
procedure Register;
begin
RegisterUnit('RegisterFCL', @RegisterFCL.Register);
end;
initialization
RegisterPackage('FCL', @Register);
end.
________________________________
William de Oliveira Ferreira
Bacharel em Sistemas de Informação
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120118/3905fe31/attachment-0002.html>
More information about the Lazarus
mailing list