[cffi-devel] help with load-foreign-library

Stelian Ionescu sionescu at cddr.org
Thu Jul 1 07:28:18 UTC 2010


On Thu, 2010-07-01 at 01:11 -0400, Daniel Herring wrote:
> On Thu, 1 Jul 2010, Stelian Ionescu wrote:
> >> Questions:
> >> 1) Am I doing it all wrong or can one do like this?
> >> 2) Is there a smart way to use the .so file to get the correct name of
> >> functions?
> >
> > That library seems to be C++ or a C library compiled with the C++
> > compiler and it doesn't export functions with C linkage, so you need to
> > make one yourself
> 
> 2) You can use nm.  Even better are object files with dwarf2 debug info... 
> They tell you just about everything imaginable.  Much better than 
> grovelling sources or headers.
> http://reality.sgiweb.org/davea/dwarf.html

Groveling the headers serves two purposes: dealing with CPP macros, i.e.
finding the value of constant macros or wrapping in a function those
that expand to code; and finding the layout and size of structs
Is DWARF information of any use in the aforementioned cases ?

-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.
http://common-lisp.net/project/iolib
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20100701/1ef1868e/attachment.sig>


More information about the cffi-devel mailing list