I built a (very simple) library, which I can call just fine from another C++ program.
But it won't work when I try to get Ruby FFI to link it. It gives FFI::NotFoundError
, says it can't find the function exported in the DLL.
Where might things have gone wrong? Do I need special treatment when I compile my DLL using g++? I am just building it with g++ -shared -o lib.dll libsrc.cpp
.
I am pretty new to Ruby, but sample code for FFI is very straightforward, and I also have code which does some pretty complex things from the user32 DLL thru FFI. So I know it works.
One more thing I can think of trying is compiling my code using visual studio in hopes of making a more "compatible" DLL, but I want to stick to GCC.