[fpc-pascal]How to use Linux libraries?

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Sat Jul 26 12:16:39 CEST 2003


On Sat, 26 Jul 2003, Rainer Hantsch wrote:

> I may be totally wrong, but as far as I understand, Linux' *.so files are the
> same as Windoze' *.dll files in their meaning. So shouldn't it be possible to
> use them in the same manner, by loading them and talking to them?

You can. Using them statically (i.e. the system loads the needed library)
is transparant on all systems. See the manual, chapter I advised you. It
describes exactly what you need.

To load libraries dynamically, you can use the dynlibs unit.
It contains cross-platform handling of shared libraries.


> | Oh, one more thing - Pasjpeg unit uses TStream classes and you said you
> | dont like Classes. But, really, they are so simple - I guarantee that
> | you will be glad when you learn how to use them and when you see what
> | TStream and it's descendants can do for you.
>
> Classes are possibly fine, otherwise they would not be such common. But as far
> as I understand, you cannot mix Class Style programming and OOP programming
> in one program (would also make life not easier, even when this would work).

It _IS_ possible to do so. Only you cannot do the following:

  TA = Object
   ...
  end;

and then
  TB = Class(TA)
  ...
  end;

i.e. you cannot mix class/object descendents. But you can use them together
in 1 program, without problem.

Michael.





More information about the fpc-pascal mailing list