Can not find unit? lazarus / 31-LCL ---------------------------------------------------------------------- MoellerCLaus · 2014-12-13 10:16 I have now spent some time finding the solution and it should be obvious but I am blinded. I have made a component that uses the Grids (TStringGrid) unit (some objects used there). When compiling it claims not to be able to find the grids.pas unit! Where to put the path correctly? I am using win32. ---------------------------------------------------------------------- howardpc · 2014-12-13 10:32 Don't set any paths. Make sure that in your component package you have a dependency on the LCL listed (use the Project Inspector). Add such a dependency if it is not listed. Then ensure your component .pas file has Code: [Select]uses  ..., grids, ...; somewhere before your component class declaration. ---------------------------------------------------------------------- JuhaManninen · 2014-12-13 10:38 It can be tricky sometimes to see the actual reason. Adding something to the Unit Search path is NOT a likely solution. First check if Lazarus Codetools can find the unit (Ctrl-Click TStringGrid). Mattias has written a nice wiki page with further instructions :   http://wiki.lazarus.freepascal.org/Unit_not_found_- _How_to_find_units Solution can be as simple as re-scanning the FPC sources. [Edit] Now I realized you are doing a package, not an application, thus howardpc likely has the right answer. LCL or unit dependency is not added automatically then. ---------------------------------------------------------------------- MoellerCLaus · 2014-12-13 13:41 Thanks to you both. But the class is defined after the uses clause. Error messages is PPU Loading C:\lazarus\lcl\units\i386-win32\grids.ppu PPU Source: grids.pas not found PPU Source: lcl_dbgrid_images.lrs not found clmcombobox.pas(55,7) Fatal: Can not find Grids used by clmCombobox, ppu=C:\lazarus\lcl\units\i386-win32\grids.ppu, package LCLBase ---------------------------------------------------------------------- howardpc · 2014-12-13 13:57 Something seems to be amiss with your grids.ppu. Perhaps the compiler finds more than one? Whatever the reason, it may be that the problem is with your Lazarus setup, not with your component package. My suggestion would be to try uninstalling Lazarus, and then reinstall clean. Drop a grid onto a new project and check that a simple do-nothing project that uses grids compiles and runs OK, before you try to compile your component package. ---------------------------------------------------------------------- MoellerCLaus · 2014-12-13 14:18 Yeah you are right PPU Loading C:\lazarus\lcl\units\i386-win32\grids.ppu PPU Source: grids.pas not found PPU Source: lcl_dbgrid_images.lrs not found PPU Source: lcl_grid_images.lrs time 2011/05/09 08:07:30 * win32wsfactory.pas(8,57) Fatal: Can not find Grids used by Win32WSFactory, ppu=..\..\units\i386-win32\grids.ppu, package LCLBase It has apparanetly nothing to do with my own package. All of the examples projects with Grids works fine. Something with the grids.pas seems to have changed here on my PC. I will have a deep dive. ---------------------------------------------------------------------- MoellerCLaus · 2014-12-16 18:52 I am not sure I really found the reason. My suspect no 1 is that if you don't reboot your PC after recompiling everything - you are going in circles! It helped me out here.... Uhhh it is a bit scary ---------------------------------------------------------------------- Cyrax · 2014-12-18 03:37 Um, normally you don't need to reboot your computer after compiling everything. Probably your antivirus/firewall is messing things up.