Recent

Author Topic: Fatal: Can not find COMPONENT used by Unit1, ppu=C:\lazarus\lpk\..\COMPONENT.ppu  (Read 3312 times)

CM630

  • Hero Member
  • *****
  • Posts: 1091
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
I am trying to create my own component, using this tutorial: http://wiki.freepascal.org/How_to_Write_a_Lazarus_Component and rather this part of it:
Code: [Select]
TEnhancedPanel = class(TCustomControl)
private
  { The new attribute for the embedded label }
  FEmbeddedLabel: TLabel;
 
public
  { The constructor must be overriden so the label can be created }
  constructor Create(AOwner: TComponent); override;
 
published
  { Make the label visible in the IDE }
  property EmbeddedLabel: TLabel read FEmbeddedLabel;
end;
 
implementation
 
constructor TEnhancedPanel.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
 
  // Set default width and height
  with GetControlClassDefaultSize do
    SetInitialBounds(0, 0, CX, CY);
 
  // Add the embedded label
  FEmbeddedLabel := TLabel.Create(Self); // Add the embedded label
  FEmbeddedLabel.Parent := self;         // Show the label in the panel
  FEmbeddedLabel.SetSubComponent(true);  // Tell the IDE to store the modified properties
  FLabel.Name := 'EmbeddedLabel';       
  FLabel.Caption := 'Howdy World!';
 
  // Make sure the embedded label can not be selected/deleted within the IDE
 //!! I did not use next line, components cannot be selected/ deleted by default, anyway//
  FLabel.ControlStyle := FLabel.ControlStyle - [csNoDesignSelectable];


 
  // Set other properties if necessary
  //...
 
end;


I compile, install, component seems quite okay, but when I try to run the app, which uses it I get:
Fatal: Can not find COMPONENT used by Unit1, ppu=C:\lazarus\lpk\..\COMPONENT.ppu
I check and  COMPONENT.ppu exists in the described place.Any idea what could I be doing wrong?
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Perhaps there is more than one component.ppu on your system.
Search for all copies (grep, or whatever) of the component.ppu and .a and .o and remove them wherever they are. (This assumes 'component.pas' has only ever been used to name the unit of your current learning component. If not, you have a problem.)
Then recompile the component package (or probably better, rebuild the IDE with the 'clean' option which will regenerate everything, including your newly installed component, in its proper path, and remove any unwanted files you have missed).

CM630

  • Hero Member
  • *****
  • Posts: 1091
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Indeed I found component.ppu in another place, I deleted all of them, tgother with the .o files.
I uninstalled the pockage.
Then in Lazarus I open Tools->Configure „Build Lazarus"-> and checked Clean all.
Then I open the LPK again, clicked Install and rebuilt Lazarus. No improvent, I keep getting the same message.





Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
If you copy all messages (shown and hidden) from the messages windows, you'll get more information.
You an also enable -va to show a lot of debug info (see project options/messages probably same for package)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

CM630

  • Hero Member
  • *****
  • Posts: 1091
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
I found out that when I open Tools->Configure „Build Lazarus"-> and check Clean all I can press a Build button. It started doing something more, I suppose that is real clean build. I am waiting for the result.


ЕДIT: BigChimp's advice helped me... I the output log it said that it could not find two files. So I copied them in Lib/i386-win32 and now the app works.
But, why don't these files get copied there by themeselves?
« Last Edit: July 22, 2014, 01:21:29 pm by paskal »
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

 

TinyPortal © 2005-2018