[fpc-pascal] bridging an C++ shared library statically

Xiangrong Fang xrfang at gmail.com
Sat Sep 21 16:04:47 CEST 2013


Hi All,

I need to use a C++ so file in FreePascal.   I have written a C wrapper for
it, which successfully connected to Pascal.

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 undefined references.

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++ so file to look for symbols required but not
defined in the C-Wrapper?

My project is hosted at: https://github.com/xrfang/CTPas/

Thanks a lot.

Xiangrong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130921/216633ec/attachment.html>


More information about the fpc-pascal mailing list