I've been experimenting with calling C routines in a library from Pascal. This seems to work:
In the Pascal source do Procedure croutine; cdecl; alias : '_croutine'; External; If there is trouble finding the routines when building, you can give the location of the routines in the Pascal source file with: {$L libcroutines.a} When compiling, the 'lib' is automatically added to the front of the file name for the library source. So far I have passed an SInt32 to the C routines so maybe you could pass the appropriately sized variable. Good luck. Ken >Date: Thu, 19 Oct 2006 07:44:30 -0700 (PDT) >From: "Leonardo M. RamÈ" <[EMAIL PROTECTED]> >Subject: Re: [fpc-pascal] mixing C and Pascal and function pointers >To: FPC-Pascal users discussions <fpc-pascal@lists.freepascal.org> >Message-ID: <[EMAIL PROTECTED]> >Content-Type: text/plain; charset=iso-8859-1 > >The C routines are inside a shared library?. Can you post the "C" code to call >these routines? > >--- Armando Navarro V·zquez <[EMAIL PROTECTED]> wrote: > >> >> Dear members: >> I am not familiar with Pascal, but I would like to call some C routines >> inside >> the main Pascal program, is there any way, to pass function pointers from >> Pascal to the C subroutines? >> Thanks in Advance >> Armando >> -- >> Dr. Armando Navarro-V·zquez >> RIAIDT. Univdade de Resonancia Magnetica >> Universidade de Santiago de Compostela >> http://desoft03.usc.es/armando/index.html >> _______________________________________________ >> fpc-pascal maillist - fpc-pascal@lists.freepascal.org >> http://lists.freepascal.org/mailman/listinfo/fpc-pascal >> > > >Leonardo M. RamÈ >http://leonardorame.blogspot.com > >__________________________________________________ _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal