哈斯克尔:在Arch Linux的缺少C库工作在Ubuntu [英] Haskell: Missing C library on Arch Linux works on Ubuntu

查看:209
本文介绍了哈斯克尔:在Arch Linux的缺少C库工作在Ubuntu的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我在工作的电脑免受的Ubuntu Arch Linux的
而我现在收到以下错误(我用堆栈来构建我的项目):

I recently switched my PC at work from Ubuntu to Arch Linux. And I am now getting the following error (I am using stack to build my project):

设置 - 简单惊天动地-1.22.4.0-GHC-7.10.2:在缺少依赖
  国外
      库:结果
      *缺少C库:HSrts-ghc7.10.2结果
      这个问题通常可以通过安装系统包来解决该
      提供这个库(您可能需要-dev版)。如果磁带库
      已经安装但在一个非标准的位置,那么你可以使用这些标志
      --extra-包含 - 迪尔斯=和--extra-LIB-迪尔斯=指定它在哪里。

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中分布的差异应该不会造成任何问题。

As far as I understand it, the difference in Linux Distribution should not cause any issue.

东西我曾尝试:结果
-add路径所在的库与--extra-LIB-迪尔斯结果
- 确保该堆栈/ GHC的版本是acrose两个系统相同的结果
-tried unsucesfully找到2系统之间的区别相关搜索
(gcc版本是不同的,但并没有改变任何东西)

Things I have tried:
-add the path where the library is with --extra-lib-dirs
-make sure that the version of stack/ghc are the same acrose both systems
-tried unsucesfully to find a relevant difference between the 2 systems
(gcc version was different but didn't change anything)

我有一个基于ubutu泊坞窗容器在那里建立无问题。

I have a docker container based on ubutu where it builds without an issue.

我能想到的唯一的事情是,因为它包含了Haskell的运行时该库得到不同于一些随机的C-库处理。但是,我不知道这种差异会是什么。或如何处理可依使用会导致对我的门系统的问题。

The only thing I can think of is that this library gets handled differently from some random C-library since it contains the Haskell-Runtime. But I have no idea what this difference would be. Or how a differnent handling would cause an issue on my Arch System.

下面我.cabal文件(该文件夹还包含整个项目):
<一href=\"https://github.com/opencog/atomspace/blob/master/tests/haskell/libExecutionOutputTest/opencoglib.cabal\" rel=\"nofollow\">https://github.com/opencog/atomspace/blob/master/tests/haskell/libExecutionOutputTest/opencoglib.cabal

Here my .cabal file (the folder also contains the whole project): https://github.com/opencog/atomspace/blob/master/tests/haskell/libExecutionOutputTest/opencoglib.cabal

推荐答案

好吧,我想出了一个解决办法,而不是在.cabal文件specifiyc库:

Okay i figured out a workaround, instead of specifiyc the library in the .cabal file:

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

将其添加到您的stack.yaml文件:

you add it to your stack.yaml file:

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

如果你也有你的.cabal文件,这将打破可执行文件中定义一个exectuable,因为该库不仅包括在库中。并包括一个可执行文件导致运行时库在瞬间segementation故障。

If you also have a exectuable defined in your .cabal file this will break the executable, since the library is not only included in the library. And including the runtime library in an executable results in an instant segementation fault.

这篇关于哈斯克尔:在Arch Linux的缺少C库工作在Ubuntu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆