From: Mike Bethany Date: 2011-07-09T13:40:06+09:00 Subject: FFI with a C++ Library --20cf307f35fa2e8f2e04a79b8b99 Content-Type: text/plain; charset=ISO-8859-1 This may be more of a C++ question but here goes: I'm trying to use Ruby FFI with a CPP library but when I compile my CPP library and look at the method names there's always a __Z5, __Z4, or __Z3 in front of the method name. I see this when I run nm against the dynlib file. Oddly when I compile a C file it works fine but I can use a C file because I'm using some CPP libraries in my library. Anyone have any ideas on how to make my library use normal names? This is what my test file looks like: # foo.cpp void foo{} To build the library I do this: g++ -c foo.cpp g++ -dynamiclib foo.o -o foo.dylib To look at the method name I do this: nm -fgj foo.dylib And this is what I get: __Z3foov ___gxx_personality_v0 dyld_stub_binder Any help is greatly appreciated. Mike --20cf307f35fa2e8f2e04a79b8b99--