[Lazarus] unit Dialogs and showmessage

Andreas Schneider aksdb at gmx.de
Wed Mar 31 20:56:09 CEST 2010

Am Mittwoch 31 März 2010 19:06:29 schrieb Bernd:
> http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/showmessage.html
> Source position: dialogs.pp line 510
> procedure ShowMessage(
>   const aMsg: String
> );
> there is also an example program:
> Program LazMessage;
>  Uses Dialogs;
>  begin
>    ShowMessage ('This is a message from Lazarus')
>  end.
> This does not compile: project1.lpr(4,16) Error: Identifier not found
> "ShowMessage"
> Also i cannot find the definition of this procedure anywhere in the
> unit dialogs and also this file is called dialogs.pas and not
> dialogs.pp on my system. How would i tell the use clause that i would
> like to use dialogs.pp instead of dialogs.pas?
> I am on linux, using fpc 2.4 and a few days old lazarus snapshot. Does
> this unit or this function not exist on other platforms than windows?
> There is no mention of this in the documentation, or is the
> documentation outdated or am i doing/understanding some completely
> wrong here?

Your project needs to have LCL as dependency, otherwise unit Dialogs is 
something completeley different. Also the LCL needs to be initialized, you 
can't just make such calls. I think it gets initialized by including the unit 
Interfaces (as first unit).

Generally it's easier to create a full fledged LCL project and not a console 

Best regards,

More information about the Lazarus mailing list