加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

Haskell:Arch Linux上缺少的C库适用于Ubuntu

发布时间:2020-12-13 23:27:44 所属栏目:Linux 来源:网络整理
导读:我最近把我的PC从Ubuntu转到了Arch Linux. 我现在收到以下错误(我使用堆栈来构建我的项目): setup-Simple-Cabal-1.22.4.0-ghc-7.10.2: Missing dependency on a foreign library: * Missing C library: HSrts-ghc7.10.2 This problem can usually be solved
我最近把我的PC从Ubuntu转到了Arch Linux.
我现在收到以下错误(我使用堆栈来构建我的项目):

setup-Simple-Cabal-1.22.4.0-ghc-7.10.2: Missing dependency on a
foreign
library:
* Missing C library: HSrts-ghc7.10.2
This problem can usually be solved by installing the system package that
provides this library (you may need the “-dev” version). If the library is
already installed but in a non-standard location then you can use the flags
–extra-include-dirs= and –extra-lib-dirs= to specify where it is.

据我所知,Linux发行版的差异不应该导致任何问题.

我尝试过的事情:
– 添加库所在的路径–extra-lib-dirs
– 确保stack / ghc的版本与两个系统都是相同的acrose
无法找到两个系统之间的相关差异
(gcc版本不同但没有改变任何东西)

我有一个基于ubutu的docker容器,它在没有问题的情况下构建.

我唯一能想到的是,这个库的处理方式与一些随机C库不同,因为它包含Haskell-Runtime.但我不知道这种差异会是什么.或者不同的处理如何导致我的Arch System出现问题.

这里是我的.cabal文件(该文件夹还包含整个项目):
https://github.com/opencog/atomspace/blob/master/tests/haskell/libExecutionOutputTest/opencoglib.cabal

解决方法

好的,我想出了一个解决方法,而不是指定.cabal文件中的库:

...  
extra-libraries: HSrts-ghc7.10.2   
...

你将它添加到你的stack.yaml文件:

...
ghc-options:
    package-name: -lHSrts-ghc7.10.2
...

如果您的.cabal文件中也定义了exectuable,则会破坏可执行文件,因为该库不仅包含在库中.并且在可执行文件中包含运行时库会导致即时的分段错误.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读