[racket] Windows FFI Problem

From: Dmitry Pavlov (dpavlov at ipa.nw.ru)
Date: Sat Jan 17 05:13:34 EST 2015

Lehi,


> I have checked and double checked the 32/64-bitness of both the library
> and the Racket installation and they are definitely the same... It
> appears that specific error I am getting is caused by the fact that
> "mylib.dll" depends on other DLL's to compile that it wasn't locating
> when the racket script was being run and when I moved it to where the
> other DLL's were, it stopped giving me that error.
>
> Good news is it's giving me a new error! Yay!
> "%1 is not a valid Win32 application.; errno=193"

If the cause of the problem remains unknown, you can try not
to rely on Windows to load the dependency DLLs, and load
them manually (before your mylib.dll) via (ffi-lib) calls.

If mylib.dll depends on some dep.dll, and dep.dll has
been already loaded prior to dep.dll, then you can be sure
than Windows will not load dep.dll from somewhere else
(where other dep.dll may exist and have wrong bitness)

Regards,

Dmitry

Posted on the users mailing list.