On Fri, Apr 22, 2011 at 19:31, Jilani Khaldi <jil...@cheapnet.it> wrote:
> {$linklib c} > > uses > dynlibs; > > procedure hello(const x: double); cdecl; external 'libmylib.so'; > > var > lHandle: TLibHandle; > v: double; > begin > lHandle := LoadLibrary('./libmylib.so'); > if lHandle <> nilHandle then > begin > v := 3.14159; > hello(v); > end else > writeln('Cannot load "mylib.so"') > end. > > It is compiled without error but when I run it it throws: > ./testlib: error while loading shared libraries: libmylib.so: cannot open > shared object file: No such file or directory. > > What I did I miss?. > You do not have the library path on the system LD_LIBRARY_PATH variable or at the ldconfig path. BTW, why don't you load it dynamically instead of statically if you are going the next mile to test it. Your program will not be executed if the library is not found either way... > Thank you. > > -- > Jilani KHALDI > ** Architectura Vindex > http://www.vindexa.org > _______________________________________________ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > Ido
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal