[SOLVED] ERROR: unable to find component class TDatasource lazarus / 21-General ---------------------------------------------------------------------- mirce.vladimirov · 2022-11-08 12:44 Existing and working project, developed under Windows8 by Lazarus 1.4.4 32-Bit, copied sources to my new laptop, with windows10 and tried to open it with Lazarus 2.2.4 32-bit. While loading the Source, an error is reported, stating (you can also see the picture attached) : Unable to find the component class "TDatasource". It is not registered via RegisterClass and no lfm was found. It is needed by unit C:\xxxyyy.... My Older computer still opens it correctly, what's the trick ? ---------------------------------------------------------------------- wp · 2022-11-08 12:49 I don't know why this happens sometimes. But for me it helps in such a case to do a clean rebuild of the IDE: "Tools" > "Configure Build Lazarus" > Check "Clean all" and "Switch after building to automatically" > "Build". ---------------------------------------------------------------------- mirce.vladimirov · 2022-11-08 12:58 Quote from: wp on November 08, 2022, 01:49:32 pmI don't know why this happens sometimes. But for me it helps in such a case to do a clean rebuild of the IDE: "Tools" > "Configure Build Lazarus" > Check "Clean all" and "Switch after building to automatically" > "Build". Tried this soon as you wrote, but did not help ---------------------------------------------------------------------- paweld · 2022-11-08 13:13 edit lfm file (e.g. in Notepad) and changeCode: [Select]TDatasourceto Code: [Select]TDataSourceand save changes ---------------------------------------------------------------------- mirce.vladimirov · 2022-11-09 09:51 Quote from: paweld on November 08, 2022, 02:13:10 pmedit lfm file (e.g. in Notepad) and changeCode: [Select]TDatasourceto Code: [Select]TDataSourceand save changes Thank you, this solved the problem. ---------------------------------------------------------------------- wp · 2022-11-09 10:34 Quote from: paweld on November 08, 2022, 02:13:10 pmedit lfm file (e.g. in Notepad) and changeCode: [Select]TDatasourceto Code: [Select]TDataSourceand save changes Thanks for clarifying - excellent observation. A simple test: Create a new project and drop a TDataSource on it. Save. Open it in an external editor and look at the spelling - it says "TDataSource" (capital S), and this is fine. Change is to "TDatasource" (lower-case s). Save. Load it in any Lazarus version using FPC 3.2.2 (Laz 2.2.0 or newer) - the project cannot be loaded due to the registration error reported.  Even FPC-main has this issue. Load it in any Lazarus version using an FPC before v3.2.2 (Laz 2.0.12 w/FPC 3.2.0 or Lau 2.0.8 w/FPC 3.0.4), and the project will load fine. Could somebody post this in an FPC bugreport? Something is broken in class registration in FPC 3.2.2 and newer. Of course, editing the lfm file is something which normally is not recommended. But fact is that I found some old projects on my disk which contain the "TDatasource" with lower-case "s" in the lfm files. How did they get there? One of the projects is the sqlite3_master_detail sample on CCR (https://sourceforge.net/projects/lazarus-ccr/files/Demos%20and%20exam ples/SQLite3%20master%20detail%20example/), dated 2009. I don't know how the lowercase-s Datasource got there, maybe a very ancient FPC version wrote such lfm files? Anyway, be careful with VERY OLD projects.