Numeric.LinearProgramming 堆栈构建失败

Numeric.LinearProgramming fails with stack build

我能够使用 stack 安装相关的库 hmatrix-glpk-0.19.0.0 但是当我 运行 stack build

我明白了

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
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

有什么想法吗?

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