Unable to get working a freepascal example

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

happyusers
Posts: 1
Joined: Mon Jun 11, 2007 5:42 pm

Unable to get working a freepascal example

Post by happyusers »

I tried to run the example included in the SDK. It does not compile. I have tried a far simpler example but I can't get it work except the GflGetVersion function. I have runtime error 216.
My example is as below :

Code: Select all

uses libgfl;
var s1:string;
    f_info:gfl_format_information;
    i:gfl_int32;
    er:integer;
begin
   gfllibraryinit;
   move(gflgetversion^,s1[1],4);
   s1[0]:=#4;
   writeln('Version : ',s1);
   er:=gflgetformatinformationbyname('jpeg',@f_info);
   writeln('Erreur ',er);
   move(f_info.description,s1[1],4);
   s1[0]:=#4;
   writeln('Format : ',s1);
   move(f_info.name,s1[1],4);
   s1[0]:=#4;
   writeln('Name : ',s1);
   i:=1;
   er:=gflgetformatinformationbyindex(i,@f_info);
   move(f_info.name,s1[1],4);
   s1[0]:=#4;
   writeln('Name : ',s1);
end.
When I run the code, I get Version : 2.17. The call to gflGetFormatInformationbyName produces an error 10 and no result, the call to gflGetFormatInformationbyIndex produces a runtime error 216 "general protection fault".
Is there anybody that has an idea of what is going on?
Thanks in advance.