Haskell ghc can';找不到它所在的模块';It’他正在努力建造
我在Arch、ghc 8.2.1和cabal 2.0上有最新的包,试图使用cabal构建ncurses包:Haskell ghc can';找不到它所在的模块';It’他正在努力建造,haskell,cabal,Haskell,Cabal,我在Arch、ghc 8.2.1和cabal 2.0上有最新的包,试图使用cabal构建ncurses包: $ cabal configure Resolving dependencies... Configuring ncurses-0.2.16... $ cabal build Preprocessing library for ncurses-0.2.16.. Building library for ncurses-0.2.16.. <no location info>:
$ cabal configure
Resolving dependencies...
Configuring ncurses-0.2.16...
$ cabal build
Preprocessing library for ncurses-0.2.16..
Building library for ncurses-0.2.16..
<no location info>: error:
module ‘UI.NCurses’ cannot be found locally
$cabal配置
正在解析依赖项。。。
正在配置ncurses-0.2.16。。。
$cabal建筑
ncurses-0.2.16的预处理库。。
为ncurses-0.2.16构建库。。
:错误:
在本地找不到模块“UI.NCurses”
上述模块是我试图构建的包的一部分,其源文件位于lib目录中。所有的东西似乎都在阴谋集团的文件中指定了,但为什么找不到呢
我试着用runhaskell构建它,但得到了同样的错误
阴谋集团档案的一部分:
extra-source-files:
cbits/hsncurses-shim.c
cbits/hsncurses-shim.h
cbits/mavericks-c2hs-workaround.h
source-repository head
type: git
location: https://john-millikin.com/code/haskell-ncurses/
source-repository this
type: git
location: https://john-millikin.com/code/haskell-ncurses/
tag: haskell-ncurses_0.2.16
-- Do not use default to using pkg-config to find ncurses libraries, because
-- the .pc files are missing or broken in many installations.
flag use-pkgconfig
default: False
manual: True
description:
Use pkg-config to set linker and include flags.
flag force-narrow-library
default: False
manual: True
description:
Force including and linking against ncurses instead of ncursesw. This is
only useful on systems that have the ncursesw package installed
incorrectly. On most systems this will cause compile- or run-time errors.
library
hs-source-dirs: lib
ghc-options: -Wall -O2
include-dirs: cbits
build-depends:
base >= 4.6 && < 5.0
, containers >= 0.2
, text >= 0.7
, transformers >= 0.2
build-tools:
c2hs >= 0.15
if flag(use-pkgconfig)
if flag(force-narrow-library)
cc-options: -DHSNCURSES_NARROW_HEADER
pkgconfig-depends: ncurses, panel
else
pkgconfig-depends: ncursesw, panelw
else
-- MacOS has a version of ncurses where the narrow- and wide-character
-- builds have been merged into a single header/dylib.
--
-- Explicitly linking against libpthread.so fixes a build problem on
-- platforms where the linker doesn't automatically follow dependencies.
if os(darwin) || os(freebsd) || flag(force-narrow-library)
cc-options: -DHSNCURSES_NARROW_HEADER
if os(darwin) || flag(force-narrow-library)
extra-libraries: panel ncurses pthread
else
extra-libraries: panelw ncursesw pthread
c-sources: cbits/hsncurses-shim.c
exposed-modules:
UI.NCurses
UI.NCurses.Panel
other-modules:
UI.NCurses.Enums
UI.NCurses.Compat
UI.NCurses.Types
额外的源文件:
cbits/hsncurses垫片c
cbits/hsncurses垫片h
cbits/mavericks-c2hs-workaround.h
源存储库负责人
类型:git
地点:https://john-millikin.com/code/haskell-ncurses/
此源存储库
类型:git
地点:https://john-millikin.com/code/haskell-ncurses/
标签:haskell-ncurses_0.2.16
--不要使用默认设置来使用pkg config查找ncurses库,因为
--在许多安装中,.pc文件丢失或损坏。
标志使用pkgconfig
默认值:False
手册:正确
说明:
使用pkg config设置链接器并包含标志。
警队狭窄图书馆
默认值:False
手册:正确
说明:
强制包括ncurses,而不是ncursesw,并针对ncurses进行链接。这是
仅适用于安装了ncursesw包的系统
不对。在大多数系统上,这将导致编译或运行时错误。
图书馆
hs源目录:lib
ghc选项:-墙壁-氧气
包括目录:cbits
构建取决于:
基数>=4.6&<5.0
,容器>=0.2
,text>=0.7
,变压器>=0.2
构建工具:
c2hs>=0.15
if标志(使用pkgconfig)
if标志(强制缩小库)
抄送选项:-DHSNCURSES\u窄头
pkgconfig取决于:ncurses,panel
其他的
pkgconfig依赖于:ncursesw,panelw
其他的
--MacOS有一个版本的ncurses,其中窄字符和宽字符
--构建已合并到单个标头/动态库中。
--
--显式链接libpthread.so修复了上的生成问题
--链接器不会自动遵循依赖关系的平台。
如果操作系统(达尔文)| |操作系统(freebsd)| |标志(强制狭窄库)
抄送选项:-DHSNCURSES\u窄头
if os(达尔文)| |标志(强制狭窄库)
额外库:面板ncurses pthread
其他的
额外库:panelw ncursesw pthread
c-来源:cbits/hsncurses shim.c
公开模块:
UI.NCurses
UI.NCurses.Panel
其他模块:
UI.NCurses.Enums
UI.NCurses.Compat
UI.NCurses.Types
我遇到了同样的问题。尽管安装了c2hs
,并且在路径中,但我所依赖的库未能安装,并显示相同的错误消息
我的解决方案是在我想要构建的项目中运行cabalclean
,并使用cabalconfigure
对其进行重新配置
我怀疑在先前的构建过程中出现了一个小问题,这使得阴谋集团认为c2hs
运行正常,而在这种情况下没有正常运行。注意到有UI.NCurses.chs
,需要用c2hs
对其进行预处理。虽然.cabal
文件需要它,但您可以检查路径上是否安装了c2hs
?是的。已安装c2hs。