[fpc-pascal] Placing binary data (resources) in object files?

Rainer Stratmann rainerstratmann at t-online.de
Tue Jun 4 12:27:44 CEST 2013


 On Tuesday 04 June 2013 12:16:24 you wrote:
>  On Monday 03 June 2013 23:49:07 you wrote:
> > Jonas,
> > 
> > It's not happening. I have a 700kb image base64 encoded in a file called
> > orangesky.res. I never use "procedure TestResource;" and yet the exe is
> > 700kb larger. The only way to get rid of that extra 700k is to delete the
> > procedure. The smart linking option or using strip do not remove the
> > 700k.
> > 
> > { TestResource procedure is not called from any code }
> > procedure TestResource;
> > const
> > 
> >   Data = {$i orangesky.res}; // 700kb constant is always built into the
> >   app
> 
> This will include binary data???
> 
> Did I miss something?
> How can you find out the legth of the included data?

I see already. You have to make a resourcefile.

It would be too good if that would work as easy as possible.

> > var
> > 
> >   S: string;
> >   I: Integer;
> > 
> > begin
> > 
> >   S := Data;
> >   for I := 1 to 10 do
> >   
> >     WriteLn(S[I * 10]);
> > 
> > end;
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal 



More information about the fpc-pascal mailing list