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

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


 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?

> var
>   S: string;
>   I: Integer;
> begin
>   S := Data;
>   for I := 1 to 10 do
>     WriteLn(S[I * 10]);
> end; 



More information about the fpc-pascal mailing list