Recent

Author Topic: class not found  (Read 2715 times)

SA.Blackmon

  • Jr. Member
  • **
  • Posts: 59
  • Just an old retired guy practicing what he enjoys.
class not found
« on: March 10, 2026, 11:59:50 pm »
Lazarus 4.4 (rev lazarus_4_4) FPC 3.2.2 i386-win32-win32/win64
windows 11

began to get a class not found error when I moved a function from a class to a utilities unit I created for generalized usage.

I can catch the error but haven't been able to find where the class is that is not found. That is not to say that I cannot find where the class (TCSVDataSet) is used but am not able to find which reference is throwing the error.
Thank you for your help,
Sherril

jamie

  • Hero Member
  • *****
  • Posts: 7663
Re: class not found
« Reply #1 on: March 11, 2026, 12:24:15 am »
During IDE OI development, Compiling or RUN-TIME?

Jamie
The only true wisdom is knowing you know nothing

cdbc

  • Hero Member
  • *****
  • Posts: 2728
    • http://www.cdbc.dk
Re: class not found
« Reply #2 on: March 11, 2026, 07:40:10 am »
Hi
Show us what you've moved...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

SA.Blackmon

  • Jr. Member
  • **
  • Posts: 59
  • Just an old retired guy practicing what he enjoys.
Re: class not found
« Reply #3 on: March 11, 2026, 03:34:48 pm »
program compiles
error occurs at runtime at formcreate in .lpr file.
Can catch the error in a try..except block but no information about where the error occurred.

The code snippet I have attached is what I moved from a class to global procedure/function. (If needs be, I could send all the code.)
For what it is worth, I commented the two and their references and the tcsvdataset in the uses clause in the unit where they reside and the error still was thrown.

It wasn't broke, i.e., I could use the functionality and then I moved it/tried to fix it.

In an attempt to localize the issue, I added (then removed) csvdataset to all the uses clauses in the project, one at a time. The issue persisted.
Thank you for your help,
Sherril

cdbc

  • Hero Member
  • *****
  • Posts: 2728
    • http://www.cdbc.dk
Re: class not found
« Reply #4 on: March 11, 2026, 04:32:38 pm »
Hi Sherril
· for TField & TFieldDef you need unit 'db' in your uses clause
· for TCSVDataset you need unit 'csvdataset' in your uses clause
· for TStringGrid you need unit 'grids' in your uses clause
· plus ofc. 'classes' & 'sysutils'
I think that should get you going...  %)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

SA.Blackmon

  • Jr. Member
  • **
  • Posts: 59
  • Just an old retired guy practicing what he enjoys.
Re: class not found
« Reply #5 on: March 11, 2026, 06:36:21 pm »
Benny,

I did a global search for TField not whole words and found in every unit where those were found the libraries were there.
Thank you for your help,
Sherril

SA.Blackmon

  • Jr. Member
  • **
  • Posts: 59
  • Just an old retired guy practicing what he enjoys.
Re: class not found
« Reply #6 on: March 11, 2026, 06:40:06 pm »
I moved the two proc's back into the unit where they were before the issue cropped up, to no avail.

Originally, they were methods of the TForm  in that unit.

Next, I will set them back up as TForm methods.
Thank you for your help,
Sherril

SA.Blackmon

  • Jr. Member
  • **
  • Posts: 59
  • Just an old retired guy practicing what he enjoys.
Re: class not found
« Reply #7 on: March 11, 2026, 06:42:48 pm »
I have moved them into the TForm class and the issue has persisted.

Thank you for your help,
Sherril

cdbc

  • Hero Member
  • *****
  • Posts: 2728
    • http://www.cdbc.dk
Re: class not found
« Reply #8 on: March 11, 2026, 06:55:15 pm »
Hi
Well, I can't read minds or see you computer from here and I'm pretty sure that goes for the rest of our forum's members too  %)
...So show us the code... :P
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

SA.Blackmon

  • Jr. Member
  • **
  • Posts: 59
  • Just an old retired guy practicing what he enjoys.
Re: class not found
« Reply #9 on: March 11, 2026, 08:00:19 pm »
I believe this is all of my project.
Thank you for your help,
Sherril

cdbc

  • Hero Member
  • *****
  • Posts: 2728
    • http://www.cdbc.dk
Re: class not found
« Reply #10 on: March 11, 2026, 09:58:46 pm »
Hi
Ok, so when I get rid of that damn laz_report stuff, I can compile and run your app, without 'class missing' error...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

SA.Blackmon

  • Jr. Member
  • **
  • Posts: 59
  • Just an old retired guy practicing what he enjoys.
Re: class not found
« Reply #11 on: March 12, 2026, 01:24:48 am »
Benny, I removed the reference to laz_report in the .lpr file.
removed it from the project inspector and moved the laz_report.pas and laz_report.lfm to another directory and the problem persists.
I'm going to junk the project and rebuild it with file I have.
Thank you for your help,
Sherril

SA.Blackmon

  • Jr. Member
  • **
  • Posts: 59
  • Just an old retired guy practicing what he enjoys.
Re: class not found
« Reply #12 on: March 12, 2026, 02:02:29 am »
I built another project using the existing files and pruned some deadwood files.
Now, I'm got an EClassNotFound error on Class TfrReport. Figured that one out now I'm back to

EClassNotFound error on Class TCsvDataSet.
Thank you for your help,
Sherril

cdbc

  • Hero Member
  • *****
  • Posts: 2728
    • http://www.cdbc.dk
Re: class not found
« Reply #13 on: March 12, 2026, 07:09:24 am »
Hi
The attached zip compiles and runs with FPC 3.2.2 & Laz 4.4 on linux 8)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

paweld

  • Hero Member
  • *****
  • Posts: 1598
Re: class not found
« Reply #14 on: March 12, 2026, 07:12:53 am »
The form ( _radius_finder.lfm ) contains the component CSVDataset1, which is not defined in the form header ( _radius_finder.pas ). Delete component from the form or add definition to TGetDiameter from ( CSVDataset1: TCSVDataset; ) and add csvdataset to uses section.
« Last Edit: March 12, 2026, 07:26:05 am by paweld »
Best regards / Pozdrawiam
paweld

 

TinyPortal © 2005-2018