[fpc-pascal] fp universal library ?

Fred van Stappen fiens at hotmail.com
Sat Feb 1 17:20:34 CET 2014


> > > On Sat, 1 Feb 2014, Fred van Stappen wrote:
> > >
> > > > Hello everybody.
> > > >
> > > > Ok, i jump...
> > >
> > > [snip]
> > >
> > > >
> > > > Stop compil showing error at dot of function TMyClass.
> > > >
> > > > => libtest.pas(14,18) Fatal: Syntax error, ":" expected but "." found
> > > >
> > > > PS : I promise, if i can do the conversion, to create a nice wiki, for dummies like me : "How to create a universal
> > > > (complicated) library with fpc"...
> > >
> > > You cannot export classes from a library. Only regular functions and procedures.
> > >
> > > Michael.
> > 
> > Aaaaarg, ok and many thanks to answer.
> > 
> > >> Only regular functions and procedures.
> > 
> > Ok but those regular functions and procedures may use other custom classes ?
> 
> Not as arguments or result of the function.
> 
> How the function is implemented internally is another matter, but you cannot export classes.
> 
> You can export pointers, but you should make it so that the caller cannot cast them back to class instances.
> That may work for simple cases, but in it's generality it will not work.
> 
> If you want to make a generally usable library, restrict your exported interface to pointers and records.
> 
> Michael.


Yep, thanks Michael.

Hum, may i export dynamic array ?
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140201/cbad5525/attachment.html>


More information about the fpc-pascal mailing list