堆栈找不到-lncursesw

问题描述 投票:2回答:1

当我尝试使用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编译时,它工作正常,并且/ usr / lib中存在libncursesw.so。我在Void Linux上。 Stack正在寻找什么想法?

haskell haskell-stack
1个回答
1
投票

这看起来像bindist Stack为Void Linux选择的问题 - 它通常猜对了,但它可能会导致某些发行版出现问题。 tinfo6变体试图加载libtinfo.so,因为一些发行版通过该共享目标文件提供ncurses6。你可以尝试configuring the variant manually - 你可能想要standard。如果你这样做,Stack将安装一个新的GHC版本,但它将改变它试图为ncurses加载的共享对象。

EDIT:

这实际上是由an issue with GHC引起的 - 如果各种ncurses文件与链接器文件之间的发行链接,而不是实际链接,GHC将不会正确地遵循它,而是抱怨该文件不存在。解决方案是使用指向目标的链接替换链接器文件。

© www.soinside.com 2019 - 2024. All rights reserved.