2

I'm trying to get the plugins package to work on Windows.

I have windows Vista 64 bit. I installed the latest Haskell Platform today (which ghc --version says 7.0.4). I installed the latest cygwin.

I run a simple example (specifically this one and after fixing various things (see here) I get this error:

Main.exe: Plug.dll: Not x86 PEi386
Main.exe: user error (Could not load module `Plug.dll')

I'm not sure where to go with this one.

I compiled the dll and test code in the same way, smae ghc:

ghc -shared -o Plug.dll Plug.hs
ghc -package ghc -o Main Main.hs

Also, I used InspectExe to check and it says the Plug.dll file is a 32 bit dll and it was able to load it successfully.

Community
  • 1
  • 1
mentics
  • 6,852
  • 5
  • 39
  • 93

1 Answers1

0

GHC does not support compiling 64-bit binaries on Windows platforms (#1884). All executables produced by GHC are 32-bit on Windows. This means that you can only link against 32-bit DLLs. Apparently, your compiled DLL wasn't compiled as 32-bit, which probably is because you used a different compiler other than MinGW to produce the DLL.

dflemstr
  • 25,947
  • 5
  • 70
  • 105