I do it all the time. It works fine in Linux as of 2.2.2. There was a problem in 2.2.0 where initialization and finalization code of units in your uses section wouldn't get called, but they do now.
------- test.lpr ------------------------------- library test; {$mode objfpc}{$H+} uses Classes, SysUtils; function SquareNumber(const input : integer) : integer; cdecl; begin writeln('libtest.so SquareNumber'); result := input * input; end; exports SquareNumber name 'SquareNumber'; begin writeln('libtest.so initialization'); end. ------------------------------------------------ ------- ctest.c ------------------------------- #include <stdio.h> int SquareNumber(const int input); main() { int input; int output; input = 4; output = SquareNumber(4); printf("%i squared is %i\n", input, output); } ----------------------------------------------- To build the .so: fpc -Sgi -CX -Xs -XX -vewnhi -l -Fu. -olibtest.so test.lpr To build the c program (make sure the .so is in your link path) gcc -o ctest -ltest ctest.c Then run it: libtest.so initialization libtest.so SquareNumber 4 squared is 16 -SG ======================== Computer over. Virus = very yes. Seth Grover sethdgrover[at]gmail[dot]com _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal