[Lazarus] Fwd: TRadioGroup not found error

Tony Whyman tony.whyman at mccallumwhyman.com
Tue Jan 1 11:47:40 CET 2019


Tom,

I made transition from Delphi about 9 years ago and never looked back. 
Yes, there are some conceptual differences, especially in the way the 
IDE works and which you have to get your head around but, generally, the 
problems are to do with the occasional name change for library 
functions, or the need to include a different mix of units and these can 
usually be resolved quickly at compile time.

Looking at your comments, I am trying to work out where you are going 
wrong. Further down the EMail, you seem to be tripping over problems 
with which units to include. Expect this as a one-off cost of moving 
from Delphi to Lazarus. The easiest way of resolving the problem with 
LCL objects is to just drop another copy of the object on the form, save 
the form and then delete the new object. The effect is to add the 
missing unit to the uses clause.

EClassNotFound is an odd one. This is a run time error in the streaming 
system - which is very similar to Delphi's streaming system. It suggests 
that you have somehow managed to include a .lfm file that includes a 
reference to a TButton, while the corresponding .pas has lost the Form's 
reference to the button.

e.g. a line such as

FButton1: TButton;

is missing. I would search the .pas file for a match on "TButton".

This can be the result of a simple "fat finger" error deleting a line by 
mistake - I have done that myself, but normally this results in an error 
message that tells you that the form reference is missing. However, if 
this was the only reference and stdctrls is not otherwise linked in then 
perhaps the error you are seeing is the result.

Referring to your point about Delphi /lib, your problem here may be the 
difference between Delphi and Lazarus packages.

It's probably best to think of Lazarus packages as compile time 
conveniences rather than as code libraries that are nicely packaged 
together in a single file. When you create a GUI application in Lazarus, 
you automatically get the LCL package "added" to you project. Its 
compiled units path then gets included in the Project's compiler and 
linker search paths. The same thing happens when you include a component 
in a third party package. You can also explicitly add packages as "New 
Requirements".

To see this in action, in any GUI Lazarus project open the Project 
Options dialog, select "Compiler Options->Compilation and Linking" in 
the left hand pane and then click on the "Show Options button. You 
should then see the full list of options passed to the compiler 
including each package's units directory. This feature is your friend 
when you are trying to work out why a unit is "not found".

When you compile a project, any dependent packages should also get 
compiled if their source code has been modified since they were last 
compiled, their object code then gets linked into the program.

Your problem with your TIndexString unit may have a similar root.

When you add a unit to a project, if its path is not already in the 
project's search path, this should get added - and you can see the 
result with "Show Options". If the unit is not added or, in particular, 
when its search path is not included in the project's "Other Unit paths" 
then the compiler will not able to find it.

Hope the above helps - it really is worth making the effort to move to 
Lazarus.

Regards

Tony Whyman

MWA Software


On 01/01/2019 02:44, Thomas Crone via lazarus wrote:
> If this is not the right forum for this,  Please tell me where I can 
> post it.
>
> I am getting the same type of message as I got a few weeks ago:
>
>    … '‘EClassNoFound’  with message:
>    Class ‘TButton’ not found
>    at address 10004A515
>
> I have tried to move to Lazarus from Delphi 4 several times over the 
> past 5 or 6 years,
> and always given up in frustration.
>
> Errors seem to pop up, go away , and come back for no apparent 
> reasons. (some of that,
> of course, could be windows problems…)
>
> I’ve been programming since 1970, first in FORTRAN II, then Algol, 
> Simula, snobol, icon,
> DEC10 assembly, various BASICs, Pascal (Turbo V2 thru Delphi, and on 
> VAX VMS), etc.
> The most recent new language was python on the Raspberry Pi.
>
> Before I retired a few years ago, I volunteered to help with the 
> Lazarus documentation,
> when I couldn’t figure out how to move my collection of units (2D & 3d 
> geometry, i/o routines,
> geographic projections & mapping, music synthesis, etc.) to Lazarus. 
> In Delphi, I could just
> put the .dcu files in the Delphi /lib directory; for the programs I’m 
> now working on, I had to
> include the entire source of my TIndexString unit in the program source.
>
> maybe I should rewrite all my objects in python…
>
> Tom Crone
>> Begin forwarded message:
>>
>> *From: *Thomas Crone <crone at cua.edu <mailto:crone at cua.edu>>
>> *Subject: **Re: [Lazarus] TRadioGroup not found error*
>> *Date: *December 15, 2018 at 9:42:45 PM EST
>> *To: *Lazarus mailing list <lazarus at lists.lazarus-ide.org 
>> <mailto:lazarus at lists.lazarus-ide.org>>
>>
>> I had some of the TForm as private and some not.
>>
>> When I took everything to of private, the error went away.
>>
>> tom
>>> On Dec 11, 2018, at 5:23 PM, Vojtěch Čihák via lazarus 
>>> <lazarus at lists.lazarus-ide.org 
>>> <mailto:lazarus at lists.lazarus-ide.org>> wrote:
>>>
>>> TRadioGroup is in unit ExtCtrls. Lazarus, however, adds it 
>>> automatically to "uses" when you insert it to form at design-time.
>>>
>>> V.
>>> ______________________________________________________________
>>> > Od: "Thomas Crone via lazarus" <lazarus at lists.lazarus-ide.org 
>>> <mailto:lazarus at lists.lazarus-ide.org>>
>>> > Komu: lazarus at lists.lazarus-ide.org 
>>> <mailto:lazarus at lists.lazarus-ide.org>
>>> > Datum: 11.12.2018 22:58
>>> > Předmět: [Lazarus] TRadioGroup not found error
>>> >
>>> My latest attempt to use Lazarus has given some odd errors…
>>>
>>> First it complained about TEdit, so I replaced that with TMemo.
>>>
>>> Now it is saying: Class “TRadioGroup” not found
>>>
>>> Do I have to add something manually to the Uses statement?
>>>
>>> I’m on Win 7 pro 64bit with Lazarus 1.8.4, 2018-05-19, FPC Ver 
>>> 3.0.4, SVN Rev. 57972, x86_64 - win64 - win32/win64
>>>
>>> Tom Cronecrone at cua.edu <mailto:crone at cua.edu>
>>>
>>> ----------
>>>
>>> -- 
>>> _______________________________________________
>>> lazarus mailing list
>>> lazarus at lists.lazarus-ide.org <mailto:lazarus at lists.lazarus-ide.org>
>>> https://lists.lazarus-ide.org/listinfo/lazarus
>>> -- 
>>> _______________________________________________
>>> lazarus mailing list
>>> lazarus at lists.lazarus-ide.org <mailto:lazarus at lists.lazarus-ide.org>
>>> https://lists.lazarus-ide.org/listinfo/lazarus
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190101/f6056def/attachment-0001.html>


More information about the Lazarus mailing list