calling c++ functions using ffi (berkeley dbxml under windows)

Andreas Raab andreas.raab at gmx.de
Sat Oct 28 20:11:08 UTC 2006


A very good article is here:

   http://en.wikipedia.org/wiki/Name_mangling

The FFI doesn't do name mangling so for calling C++ functions so you 
either need to provide the mangled name or provide a wrapper function 
(via extern "C").

Cheers,
   - Andreas

Petr wrote:
> Hello,
> I am trying to use Berkeley DB XML from withing Squeak. I already found 
> out how to call C functions, but I got stuck on "Error : can't find 
> function address" when calling a function in a C++ shared library. So I 
> first looked up some info on the Squeak wiki and found this: 
> http://minnow.cc.gatech.edu/squeak/3735. I used nm from mingw on the 
> libdbxml22.lib and got a lot of some information I do not exactly 
> understand. An example:
> 
> libdbxml22.dll:
> 00000000 I .idata$4
> 00000000 I .idata$5
> 00000000 I .idata$6
> 00000000 T .text
> 00000000 T ?abort at XmlTransaction@DbXml@@QAEXXZ
> 00000000 I _imp_?abort at XmlTransaction@DbXml@@QAEXXZ
>          U _IMPORT_DESCRIPTOR_libdbxml22
> 
> libdbxml22.dll:
> 00000000 I .idata$4
> 00000000 I .idata$5
> 00000000 I .idata$6
> 00000000 T .text
> 00000000 T ?add at XmlResults@DbXml@@QAEXABVXmlValue at 2@@Z
> 00000000 I _imp_?add at XmlResults@DbXml@@QAEXABVXmlValue at 2@@Z
>          U _IMPORT_DESCRIPTOR_libdbxml22
> 
> Any pointers to some resources how should I continue are appreciated.
> 
> --Petr
> 
> 
> 




More information about the Squeak-dev mailing list