<div dir="ltr"><div class="gmail_quote">On Fri, Apr 22, 2011 at 19:31, Jilani Khaldi <span dir="ltr"><<a href="mailto:jilani@cheapnet.it">jilani@cheapnet.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
{$linklib c}<br>
<br>
uses<br>
dynlibs;<br>
<br>
procedure hello(const x: double); cdecl; external 'libmylib.so';<br>
<br>
var<br>
lHandle: TLibHandle;<br>
v: double;<br>
begin<br>
lHandle := LoadLibrary('./libmylib.so');<br>
if lHandle <> nilHandle then<br>
begin<br>
v := 3.14159;<br>
hello(v);<br>
end else<br>
writeln('Cannot load "mylib.so"')<br>
end.<br>
<br>
It is compiled without error but when I run it it throws:<br>
./testlib: error while loading shared libraries: libmylib.so: cannot open shared object file: No such file or directory.<br>
<br>
What I did I miss?.<br></blockquote><div><br>
You do not have the library path on the system LD_LIBRARY_PATH variable or at the ldconfig path.<br><br>BTW, why don't you load it dynamically instead of statically if you are going the next mile to test it. <br>Your program will not be executed if the library is not found either way...<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Thank you.<br><font color="#888888">
<br>
--<br>
Jilani KHALDI<br>
** Architectura Vindex<br>
<a href="http://www.vindexa.org" target="_blank">http://www.vindexa.org</a><br>
_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
</font></blockquote></div><br><br>Ido<br></div>