[sane-devel] attach xsane.ico to xsane.exe

Oliver Rauch Oliver.Rauch@Rauch-Domain.DE
21 May 2004 00:20:14 +0200


The problem is solved.

If someone is interested in it:
This is how it works on windows with cygwin and gcc:

1) create a text resource file appicon.rc:
 
AppIcon ICON "xsane.ico"

   where xsane.ico is the file that contains the
   icon that shall be included into the executable


2) create a ressource that contains all necessary
   information that is needed to link it with gcc:

windres -i appicon.rc -o appicon.opc

   (it is important to name it opc, not res!)

3) link it as if it is an object file, simply add
   it to the list of object files while linking
   all abject files to the executable

Thats it.

Oliver

Am Don, 2004-05-20 um 23.44 schrieb Oliver Rauch:
> Hello Julien,
> 
> I am using cygwin with gcc. I already found out that
> I have to create a ressource that contains the icon.
> There is a program "windres" that can create resources
> and I am able to create a icon.res file.
> 
> Now I have to find out how to tell the linker to
> link the ressource into the executable...
> 
> Oliver
> 
> 
> Am Don, 2004-05-20 um 21.09 schrieb Julien BLACHE:
> > Oliver Rauch <Oliver.Rauch@Rauch-Domain.DE> wrote:
> > 
> > Hi,
> > 
> > > Can anyone give me a hint how I can
> > > attach an icon (xsane.ico) into an executable
> > > (xsane.exe) on a win32 environment?
> > 
> > I'm no win32 expert, but afaik the icon is a resource of the
> > executable. If you use MSVC, it's easy to do (can't remember how to do
> > it, though), otherwise there are plenty of win32 resource editors
> > available everywhere :)
> > 
> > JB.
>