[fpc-devel]'FPC_INITIALIZEUNITS' [was] LINKING a pp libraryfrom...

Javier Ros Ganuza jros at unavarra.es
Wed May 23 16:04:41 CEST 2001


Michael, it worked!!!!.

Do you want me to add some footnote comment on the

programer's manual->programing libraries->Using a library from a C
program ??


Many thanks

Michael Van Canneyt wrote:
> 
> On Wed, 23 May 2001, Javier Ros Ganuza wrote:
> 
> > Michael, thanks for your quick answer:
> >
> > I'm now trying to elucidate how to call such a function, and the only
> > reference I've found to it has been something like
> > emitinsertcall('FPC_INITIALIZEUNITS'); within the compiler source, but I
> > don't know how to call such function from a normal program. Could you be
> > more specific or point me to some place within the docs or to some
> > example?. I haven't benn able to find more information...
> 
> You must simply declare it as an external procedure, and call it.
> This is explained in the docs.
> 
> In a C program you should declare something like
> 
> extern void FPC_INITIALIZEUNITS (void);
> 
> and then just
> 
> main () {
> 
>   FPC_INITIALIZEUNITS();
> 
> }
> 
> in a pascal program, do a
> 
> procedure FPC_INITIALIZEUNITS; external;
> 
> begin
>   FPC_INITIALIZEUNITS;
> 
> >
> > I supouse that I have to make a especial mylibrary initialization
> > procedure, to be called from the main C program, though library, unlike
> > units, do not have initialization and termination codes.
> >
> > Could be a more elegant trick to put a specific intialization unit in
> > the uses clause of the library ?
> 
> No that will not help.
> 
> Michael.
> 
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel

-- 
Javier Ros Ganuza.
Dpto. Ingeniería Mecánica./Ingeniaritza Mekanika Saila.
Univ. Pública de Navarra./Nafarroako Unibertsitate Publikoa.
 Campus de Arrosadia s/n. 31006 Iruñea.
Tel. 34 948169307 Fax. 34 948169099




More information about the fpc-devel mailing list