haskell - Windows 10 上的 ghci 错误 : user specified . o/.so/.DLL 无法加载(addDLL: pthread

标签 haskell package pthreads ghci

我已经在 Windows 10 上安装了 Haskell Platform 版本 8.2.2(完整版,64 位)。ghc 可以运行,WinGHCi 也可以运行。有几个问题: -- 在 cygwin 中运行 ghci 会出现此错误:

GHCi,版本 8.2.2:http://www.haskell.org/ghc/ :?求助 :无法加载用户指定的.o/.so/.DLL(addDLL:未加载pthread或依赖项。(Win32错误193))尝试加载时:(动态)pthread搜索到的其他目录:(无)

-- 在 PowerShell 中运行 ghci 只会导致 PowerShell 卡住 -- 使用 cabal 安装软件包会产生类似的错误消息 -- ghc-pkg 检查会产生大量警告,包括许多涉及 ghc-8.0.1 的警告,这是在我的计算机上运行的最新版本的 ghc 未设置 GHC_PACKAGE_PATH。我在配置中找不到任何引用 ghc-8.0.1 的内容。 (cabal.config 文件包含 Haskell 平台下载页面中给出的定义。)

错误消息“:用户指定的.o/.so/.DLL无法加载(addDLL:pthread或依赖项未加载。(Win32错误193))的原因和解决方法是什么?

最佳答案

尝试使用系统管理员权限运行 GHCI(在“开始”中键入“Command Pro...”,然后单击“以管理员身份运行”)。 如果 ghci 现在可以工作,则问题已解决,因为您现在可以访问文件 c:\Windows\System32\pthread.dll

要在没有管理员权限的情况下使用 ghci(推荐),请更改权限(当您拥有管理员权限时),以便用户可以读取 pthread.dll 文件:

C:\> CACLS c:\Windows\System32\pthread.dll/e/p 你的用户名:r

(将 your-username 替换为您的实际用户名)

此修复归功于此帖子:https://faculty-web.msoe.edu/hasker/cs3040/ghc-install.html

关于haskell - Windows 10 上的 ghci 错误 : user specified . o/.so/.DLL 无法加载(addDLL: pthread,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49637459/

相关文章:

multithreading - 线程互斥锁 : pthread_mutex_unlock() consumes lots of time

haskell - 使用镜头访问不存在的字段时如何避免默认返回值?

haskell - Facebook 的小鸭子无法正确识别时间维度

android - 我如何检测android中特定包的删除?

node.js - 使用 npm 我如何将包下载为 zip,包中包含其所有依赖项

c - 在 C 中,如何在创建线程时将变量传递给 Pthreads 中的函数?

haskell - 使用匿名函数折叠

haskell - SPECIALIZE 编译用语的误解

python - 开发python包的正确方法

c - pthread 如何返回最快的结果并终止较慢的结果?