At Mon, 26 Sep 2016 00:56:57 -0700 (PDT), Lehi Toskin wrote: > I've been trying to make asumu's rsvg package working on Windows, but Racket > keeps complaining that it cannot find librsvg-2-2.dll. I have verified that > the DLL is exporting its symbols, is the correct bit-ness, and is in the > right > directories - all to no effect. I have have even recompiled it with mingw-w64 > just to be sure the DLL wasn't corrupted or something, but that didn't change > anything. > > As a little test, I made a small DLL in C which was indeed picked up by the > FFI and I could use its single function, but I took that same DLL and added > an > RSVG function, the FFI complained that my DLL was nowhere to be found! > > I'm at my wit's end. Is there anything else I could try doing? Could it be > there's something wrong with the FFI that would make it incorrectly raise an > error or maybe even improperly interact with a DLL?
I see that "librsvg-2-2.dll" has many dependencies, and I bet there's an issue finding one of the dependencies. As I recall, the error message from the system will not distinguish between "librsvg-2-2.dll" not being found and one of its dependencies not being found. That would explain why you got the "not found" message for your own DLL after linking to "librsvg-2-2.dll": if "librsvg-2-2.dll" or one of it's dependencies wasn't found, the error would suggest that your own DLL wasn't found. Assuming that you have all of the dependencies in place, my guess is that it's a question of the search path. When you use `ffi-lib` to load a DLL, it looks in certain places; when "x.dll" depends on "y.dll", Windows looks in certain places for "y.dll" as a dependency of "x.dll" --- and, unfortunately, the latter is a subset of the former places. Various Racket FFI bindings use the strategy of explicitly loading "y.dll" before attempting to load "x.dll", so the the previously loaded "y.dll" satisfies the dependencies of "x.dll". So, I recommend trying to load the dependencies of "librsvg-2-2.dll" directly, find out whether each of those works, check dependencies for one that doesn't work, and so on. (I use Dependency Walker to view DLL files, and it shows dependencies and dependencies of dependencies in a nice way.) -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.