[Lazarus] About {$R *.res}...

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed Oct 8 13:33:54 CEST 2008


On Wed, Oct 8, 2008 at 3:28 AM, John vd Waeter <john at jvdw.nl> wrote:
> To polish my application (WinCE, KOL-CE) I wanted to add an icon to the
> executable.
>
> I was suggested to create a resource-file in Delphi, add a Mainicon to
> it and copy the res-file in my application source dir.

This isn't a good idea. The .res format used by borland ist not the
same one used by Free Pascal (which is the GNU format). They are not
compatible and linking would fail.

You can instead create a .rc file and add it with {$R myrcfile.rc}

Here is an example:

http://magnifier.svn.sourceforge.net/viewvc/magnifier/trunk/magnifier.rc?revision=42&view=markup

http://magnifier.svn.sourceforge.net/viewvc/magnifier/trunk/resource.h?revision=42&view=markup

I don't remember exactly which icon will be set for the mainicon...
maybe the lower ID one?

Note that this doesn't answer your question. I don't know why the IDE
is commenting your {$R }.

-- 
Felipe Monteiro de Carvalho



More information about the Lazarus mailing list