Updated:
I moved this question for Programming > General, I think makes more sense.
http://forum.lazarus.freepascal.org/index.php/topic,43455.msg304118.htmlSorry.
-------
I can't import a Unit created by me in a Pascal project using Lazarus IDE and fpWeb framework that is used for open a HTTP connection.
The following error occurs when I compile the project with Unit
x_inicializacao implemented in the Main file:
Projeto.lpr(18,1) Error: Error while linking
I'm using the TFPWebModule class and I need call a function of the Unit that I created in the procedure of the fpWeb:
procedure DataModuleRequest(Sender: TObject; ARequest: TRequest; AResponse: TResponse; var Handled: Boolean);
How can I proceed?
Thanks.
Main file (Main.pas):// x_inicializacao import, with I delete this import the project is compiled without errors.
uses SysUtils, Classes, httpdefs, fpHTTP, fpWeb, x_inicializacao;
procedure TFPWebModule1.DataModuleRequest(Sender: TObject; ARequest: TRequest;
AResponse: TResponse; var Handled: Boolean);
var CaminhoArquivo: String;
Schema: String;
DataInicial: String;
DataFinal: String;
CodigoUnidade: Integer;
begin
Schema := ARequest.QueryFields.Values['Schema'];
DataInicial := ARequest.QueryFields.Values['DataInicial'];
DataFinal := ARequest.QueryFields.Values['DataFinal'];
CodigoUnidade := StrToInt(ARequest.QueryFields.Values['CodigoUnidade']);
// With I delete the following line the project is compiled without errors:
CaminhoArquivo := gerar(Schema, DataInicial, DataFinal, CodigoUnidade);
AResponse.ContentType := 'text/plan';
AResponse.Contents.LoadFromFile(CaminhoArquivo);
Handled := True;
end;