堆栈找不到 -lncursesw
Stack can't find -lncursesw
当我尝试使用 Stack 编译我的 Haskell 程序时,出现以下错误:
Building executable 'fractal' for fractal-0.1.0.0..
[1 of 2] Compiling Main ( app/Main.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.2.0.1/build/fractal/fractal-tmp/Main.o )
<command line>: can't load .so/.DLL for: /usr/lib/gcc/x86_64-unknown-linux-gnu/8.2.0/../../../../lib/libtinfo.so (-lncursesw: cannot open shared object file: No such file or directory)
-- While building custom Setup.hs for package fractal-0.1.0.0 using:
/home/lorxu/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.2.0.1 build lib:fractal exe:fractal --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
当我直接用 GHC 编译时,它工作正常,libncursesw.so 出现在 /usr/lib 中。我在 Void Linux。 Stack 正在寻找什么想法?
这看起来像是 bindist
Stack has chosen for Void Linux 的问题 - 它通常猜对了,但它可能会导致某些发行版出现问题。 tinfo6
变体尝试加载 libtinfo.so
,因为某些发行版通过该共享对象文件提供 ncurses6
。您可以尝试 configuring the variant manually - 您可能需要 standard
。如果您这样做,Stack 将安装一个新的 GHC 版本,但它会更改它尝试为 ncurses
.
加载的共享对象。
编辑:
这实际上是由 an issue with GHC 引起的 - 如果发行版 links 在各种 ncurses
文件之间带有 linker file,而不是实际的 link,GHC 不会正确地遵循它,而是抱怨文件不存在。解决办法是用link替换linker文件到目标
当我尝试使用 Stack 编译我的 Haskell 程序时,出现以下错误:
Building executable 'fractal' for fractal-0.1.0.0..
[1 of 2] Compiling Main ( app/Main.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.2.0.1/build/fractal/fractal-tmp/Main.o )
<command line>: can't load .so/.DLL for: /usr/lib/gcc/x86_64-unknown-linux-gnu/8.2.0/../../../../lib/libtinfo.so (-lncursesw: cannot open shared object file: No such file or directory)
-- While building custom Setup.hs for package fractal-0.1.0.0 using:
/home/lorxu/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.2.0.1 build lib:fractal exe:fractal --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
当我直接用 GHC 编译时,它工作正常,libncursesw.so 出现在 /usr/lib 中。我在 Void Linux。 Stack 正在寻找什么想法?
这看起来像是 bindist
Stack has chosen for Void Linux 的问题 - 它通常猜对了,但它可能会导致某些发行版出现问题。 tinfo6
变体尝试加载 libtinfo.so
,因为某些发行版通过该共享对象文件提供 ncurses6
。您可以尝试 configuring the variant manually - 您可能需要 standard
。如果您这样做,Stack 将安装一个新的 GHC 版本,但它会更改它尝试为 ncurses
.
编辑:
这实际上是由 an issue with GHC 引起的 - 如果发行版 links 在各种 ncurses
文件之间带有 linker file,而不是实际的 link,GHC 不会正确地遵循它,而是抱怨文件不存在。解决办法是用link替换linker文件到目标