Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-04

IDE complains about missing Register procedure.

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Donald Ziesig

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170427/c17457bc/attachment.html>

Reply by email

Donald Ziesig
to Donald Ziesig
Donald Ziesig 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.

Show quoted text 59 lines
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170427/e5a4c224/attachment.html>

Reply by email