[Gambas-user] Calling library functions in Gambas2

Benoit Minisini gambas at ...1...
Mon Sep 3 16:59:27 CEST 2007


On dimanche 02 septembre 2007, easuter wrote:
> Benoit Minisini wrote:
> > On jeudi 30 août 2007, easuter wrote:
> >> However, calling the simplest function in libparted
> >> (ped_get_version) did not return anything useful, but then again, I'm
> >> probably doing something wrong.
> >>
> >> PUBLIC EXTERN ped_get_version() AS String IN "libparted"
> >>
> >> PUBLIC SUB main()
> >>    PRINT ped_get_version()
> >> END
> >>
> >> returns an empty string.
> >> If I make the extern declaration use an Integer as the return data-type
> >> for
> >> ped_get_version, then a very useless number is returned (-1212003088).
> >> Same happens when made to use Pointer and if I use
> >> StrPtr(ped_get_version()), then the same empty string is returned as
> >> when I
> >> use the String datatype.
> >>
> >> I'd really appreciate any help in pointing out mistakes here, and if
> >> possible some indicators as to what can be done about the
> >> ped_filesystem_type_get function.
> >>
> >> Cheers,
> >>
> >> Eugéne
> >
> > Apparently this is a bug... Try the latest revision, it should work now!
> >
> > Regards,
> >
> > --
> > Benoit Minisini
>
> Well, I've got Gambas 1.9.50 up and running here, as well as the latest
> parted release installed.
> Still no joy though, ped_get_version() continues to return an empty string
>
> :-\

You must install the last subversion revision, not the last release.

Regards,

-- 
Benoit Minisini




More information about the User mailing list