Windows10下ghci无法使用的解决方案

Posted heapheapstack

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Windows10下ghci无法使用的解决方案相关的知识,希望对你有一定的参考价值。

遇到的问题:在安装Haskell Platform Core 8.4.3版本后,在命令行中输入ghci,使用该交互环境时报错。

报错信息如下:省略号是一系列类似ghci去各种路径查找都没找到的信息

GHCi, version 8.4.3: 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)

........

解决方案:似乎是因为系统中已经存在的Lilypond,当前的Haskell Platform与其不兼容。以下解决方案摘自Euterpea 有趣的是这是一个Haskell的音乐创作库,它竟然记录了如何解决这个看似需要在win10下安装pthread但实际上并非如此的bug。

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)LilyPondusrin

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.

因为很久没有使用LilyPond,未来很可能也不会使用,就采用了第三种,直接卸载了LilyPond。问题解决。


以上是关于Windows10下ghci无法使用的解决方案的主要内容,如果未能解决你的问题,请参考以下文章

func = elem [1..10]在GHCi中有效,但无法编译

Windows 10无法使用debug的解决方案

Windows 10下无法安装 CAD 2013/2014的解决方法

佳能打印机iRADV_C5200Series在windows 10下无法使用电子复印的解决方法

转Windows10下80端口被PID为4的System占用导致Apache无法启动的分析与解决方案

如何解决win10无法访问\\