[fpc-devel] Enabling use of {$R *.dfm} on Windows

Michael Van Canneyt michael at freepascal.org
Thu Jul 26 18:01:19 CEST 2007



On Thu, 26 Jul 2007, Sergei Gorelkin wrote:

> Michael Van Canneyt wrote:
> > 
> > On Wed, 25 Jul 2007, Sergei Gorelkin wrote:
> > 
> > > Michael Van Canneyt wrote:
> > > > Hi,
> > > >
> > > > The name of the resource linker can now be set with -FR<x>. This binary
> > > > should transform a resource file file to a .o file.
> > > >
> > > > You can also specify the name of the recource compiler with -FC. This
> > > > binary
> > > > should transform a resource source file to a .o file.
> > > > (normally used for .rc files)
> > > >
> > > > Both options expect the name of a binary (will be searched in the PATH),
> > > > and
> > > > the binary should handle the same options as windres does. 
> > > To make sure that I understand things right:
> > > - The new utility is supposed to be invoked as 'fpc -FR<name> <all other
> > > options>';
> > 
> > Yes.
> > 
> > > - The new utility has nothing to do with -FC switch;
> > 
> > Currently not.
> > 
> After initial testing with r8164, things appear to be exactly opposite than I
> imagined initially: the utility must be specified in -FC switch and has
> nothing to do with -FR. This is due to recent changes in resource handling, I
> guess.

There are no changes, except that you can configure the used utility.

However, I noticed that my explanation was wrong. -FC is used to create a
.res file, -FR is used to create a .o file:

see comprsrc.pas:

  if output=roRES then
    Bin:=SelectBin(RCCompiler,target_res.rcbin) // Set using -FC
  else { roOBJ, create object file }
    Bin:=SelectBin(ResCompiler,target_res.resbin); // Set using -FR

Michael.

> 
> Basically it works this way (the only required thing is to change "windres1"
> name back to "windres" in windr.pp).
> 
> However, I ended up realizing that my binutils (2.9.5) are too outdated.
> Windres 2.9.5 has a bug - it does not round resource header length up to a
> dword boundary, so created .res files are correct only if resource name length
> is odd. This bug appears to be fixed in recent 2.17.50, but in turn it does
> not work without '--use-temp-file' commandline switch...
> I believe I must set this stuff up properly before going further.
> 
> So the questions are:
> 1) what version of binutils is the 'current' for FPC development?
> 2) Is it possible to download it somewhere in one piece like crossbinutils
> (i.e. compiled binaries for win32 only and without fpc binaries)?
> 
> Sergei
> 
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> 
> 



More information about the fpc-devel mailing list