<div dir="ltr"><div><div>Ok, but when I added these:<br><br><br>implementation<br>{$linklib libthostintf.a}<br>{$linklib thostmduserapi.so}<br>end.<br><br></div>I got:<br><br>/usr/bin/ld: cannot find -lthostmduserapi<br><br>
</div>All the required .so and .a file are in CURRENT dir.<br><br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/21 Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
On Sat, 21 Sep 2013, Xiangrong Fang wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi All,<br>
<br>
I need to use a C++ so file in FreePascal. I have written a C wrapper for it, which successfully connected to Pascal.<br>
<br>
Now my question is, can I use the $linklib directive to link the C-Wrapper STATICALLY, which in-turn use the shared so file? I tried to do this but it complained a lot of<br>
undefined references.<br>
</blockquote>
<br></div>
This is normal.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The key problem is, the {$linklib} instruction only tell FPC where to look for external functions in the C Wrapper, but how can I tell the linker to look for the ORIGINAL C++<br>
so file to look for symbols required but not defined in the C-Wrapper?<br>
</blockquote>
<br></div>
{$linklib XYZ}<br>
<br>
can be used for any library. So you should add the C wrapper library, C++ library,<br>
and probably some others as well, such as the C++ STL.<span class="HOEnZb"><font color="#888888"><br>
<br>
Michael.</font></span><br>_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">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></blockquote></div><br></div>