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
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
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
is missing. I would search the .pas file for a match on
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
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.
On 01/01/2019 02:44, Thomas Crone via
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
… '‘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
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
To use your units in Lazarus, make a new package, then copy all units to a single subdir (with the Lpk package), then add all pas units to this package. So user needs to install this package. So all pas files will be auto found by program if program uses this package.
lazarus mailing list
[hidden email] https://lists.lazarus-ide.org/listinfo/lazarus
In reply to this post by Free Pascal - Lazarus mailing list
On Tue, Jan 1, 2019 at 4:44 AM Thomas Crone via lazarus
<[hidden email]> wrote:
> Errors seem to pop up, go away , and come back for no apparent reasons. (some of that,
> of course, could be windows problems…)
It can also be that your Lazarus installation is screwed by some old
Please remove all such directories and especially compiled units.
Remove user configuration, too.
Then install a new version. I recommend the latest 2.0RC3.