首页 > 解决方案 > Numeric.LinearProgramming 因堆栈构建而失败

问题描述

我能够使用堆栈安装相关的库 hmatrix-glpk-0.19.0.0 但是当我运行堆栈构建时

我明白了

error:
    Could not load module ‘Numeric.LinearProgramming’
    It is a member of the hidden package ‘hmatrix-glpk-0.19.0.0’.
    Perhaps you need to add ‘hmatrix-glpk’ to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
4 | import Numeric.LinearProgramming
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

任何的想法 ?

标签: haskellhaskell-stack

解决方案


使用 Stack 构建的程序不能使用任何他们想要的已安装包。他们使用的每个包都需要在他们的 cabal 文件(如您的错误所示)或 package.yaml 中列为依赖项。添加hmatrix-glpk到您拥有的任何一个,然后重试。


推荐阅读