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

Daniel Herring dherring at tentpost.com
Thu Jul 1 05:11:28 UTC 2010


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

FYI, here's everything you want to know about C++ calling conventions 
(hint: they can often be used without a C wrapper).
http://www.agner.org/optimize/calling_conventions.pdf

- Daniel




More information about the cffi-devel mailing list