I have a simple C DLL that exposes functions from a static library. The DLL compiles without errors and I can run DUMPBIN on it to see the exports. However, when I attempt to load it with DllImport
in C#, it says this:
System.DllNotFoundException: Unable to load DLL 'ei.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E).
It's in the correct directory, for sure. So, I read that it might be a good idea to try Dependency Walker, in case I need to include something else. Unfortunately, when I try to open my DLL in DW, I get this:
Error: At least one file was not a 32-bit or 64-bit Windows module.
Here's my cl
command:
set ERL_INTERFACE_DIR=C:\Progra~1\erl5.7.2\lib\erl_interface-3.6.2\
call vcvars32.bat
cl /I%ERL_INTERFACE_DIR%include /LD ei.c ei.lib Ws2_32.lib /link /LIBPATH:%ERL_INTERFACE_DIR%lib
What could be causing this?