[Lazarus] IDE complains about missing Register procedure.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] IDE complains about missing Register procedure.

Free Pascal - Lazarus mailing list

Well, I found a bug in Lazarus 1.9 that I thought went away with Lazarus 1.2.

I am in the process of refactoring the code from libraries I created in Delphi back in the early 1990's (I learned a lot since then :-D).

I created a package, and copied a previously working component's .pas file into its directory, then added it to the package itself.  The Package compiles with no errors. 

When I clicked on Use | Install, I got the error message:

The package arsmagicagui does not have any "Register" procedure, which typically means, it does not provide any IDE addon. Installing it will probably only increase the size of the IDE and may even make it unstable.

Within the component code I have:

procedure Register;

implementation

uses
  LazLogger,
  Math;

procedure Register;
begin
  RegisterComponents('Ars Magica',[TAMFormPanel]);
end;

Within the package code I have:

uses
  AMFormPanel, LazarusPackageIntf;

implementation

procedure Register;
begin
  AMFormPanel.Register; // I added this.  It did not change the error.
end;

initialization
  RegisterPackage('arsmagicagui', @Register);
end.   

Years ago, I remember getting this error while I was first experimenting with Lazarus, but it went away (not sure why) and I have been able to create many components in the intervening time.

What did I do wrong? :-[

Thanks,

Don Ziesig



--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IDE complains about missing Register procedure. [SOLVED]

Free Pascal - Lazarus mailing list
On 04/27/2017 05:52 PM, Donald Ziesig via Lazarus wrote:

Well, I found a bug in Lazarus 1.9 that I thought went away with Lazarus 1.2.

It is not a bug in the code, just a very obscure and not well documented checkbox that only appears when the particular file is selected in the Package dialog.  The option is "Register unit" and it must be checked so the IDE knows what to do with it.

I am in the process of refactoring the code from libraries I created in Delphi back in the early 1990's (I learned a lot since then :-D).

I created a package, and copied a previously working component's .pas file into its directory, then added it to the package itself.  The Package compiles with no errors. 

When I clicked on Use | Install, I got the error message:

The package arsmagicagui does not have any "Register" procedure, which typically means, it does not provide any IDE addon. Installing it will probably only increase the size of the IDE and may even make it unstable.

Within the component code I have:

procedure Register;

implementation

uses
  LazLogger,
  Math;

procedure Register;
begin
  RegisterComponents('Ars Magica',[TAMFormPanel]);
end;

Within the package code I have:

uses
  AMFormPanel, LazarusPackageIntf;

implementation

procedure Register;
begin
  AMFormPanel.Register; // I added this.  It did not change the error.
end;

initialization
  RegisterPackage('arsmagicagui', @Register);
end.   

Years ago, I remember getting this error while I was first experimenting with Lazarus, but it went away (not sure why) and I have been able to create many components in the intervening time.

What did I do wrong? :-[

Thanks,

Don Ziesig






--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus