8
votes

I've installed Haskell Platform version 8.2.2 (Full, 64 bit) on Windows 10. ghc works, and also WinGHCi. There are several problems: -- Running ghci in cygwin gives this error:

GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help : user specified .o/.so/.DLL could not be loaded (addDLL: pthread or dependencies not loaded. (Win32 error 193)) Whilst trying to load: (dynamic) pthread Additional directories searched: (none)

-- Running ghci in PowerShell just causes PowerShell to freeze -- Installing packages with cabal produces a similar error message -- ghc-pkg check produces a large number of warnings, including many that refer to ghc-8.0.1, which is the most recent version of ghc that works on my computer GHC_PACKAGE_PATH is not set. I can't find anything in my configuration that refers to ghc-8.0.1. (The cabal.config file contains the definitions given in the Haskell Platform download page.)

What is the cause and the cure for the error message ": user specified .o/.so/.DLL could not be loaded (addDLL: pthread or dependencies not loaded. (Win32 error 193))?

2
I don't know. Just to say that personally, I use the CMDER terminal, and it is great.Stéphane Laurent

2 Answers

4
votes

I can't post in comments so I'll provide what I found here. Feel free to delete my "answer" if this doesn't follow any stackoverflow guideline.

I ran into the same error with a fresh install of the full 64bit Haskell Plateform on Windows 10.

I tried messing around with the pthread.dll submitted by another project (Lilypond to be exact). I added it to one of the additional directories added by Stack when ghci is run through stack ghci.

Ghci can find it but can't load it. So the problem isn't about ghci failing to find any stuff related to pthread.

Here is the output for reference:

$ stack ghci
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
GHCi, version 8.2.2: http://www.haskell.org/ghc/  :? for help
<command line>: user specified .o/.so/.DLL could not be loaded (addDLL: C:\Users\Alice\AppData\Local\Programs\stack\x86_64-windows\msys2-201505)
Whilst trying to load:  (dynamic) C:\Users\{user}\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin\pthread.dll
Additional directories searched:   C:\Users\{user}\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin
   C:\Users\{user}\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib

I don't have any further information yet. However I hope what I provided can help.

2
votes

This page illuminates: http://euterpea.com/troubleshooting/

"Trying to start GHCi, WinGHCI, or running GHC fails with errors related to pthread.dll, such as: user specified .o/.so/.DLL could not be loaded (addDLL: pthread or dependencies not loaded. (Win32 error 193))

If you have Lilypond installed, this is unfortunately a known incompatibility with recent versions of Haskell Platform right now. There are only three ways to solve it for now:

Option 1: Remove Lilypond’s bin folder from your PATH environment variable. If you have a user path and a system path, you must remove Lilypond-related entries from BOTH, not just the user’s path. You may need to reboot for GHCi to work again. You should still be able to run the GUI for Lilypond by making a desktop shortcuts directly to Lilypad.exe. If using from command line, calling the executables with the full path to the containing folder. Unless you used a custom installation location, the Lilypad, lilypond, midi2ly, and other programs that come with Lilypond will be located in this folder: C:\Program Files (x86)\LilyPond\usr\bin

Option 2: Use Haskell Platform 8.0.2a (core or full).

Option 3: Uninstall Lilypond. This is only recommended if it’s an old installation and you don’t plan on using it anymore. Otherwise, try option 1 first."

HTH