Haskell 哈斯凯尔博士和外国金融机构

Haskell 哈斯凯尔博士和外国金融机构,haskell,doctest,Haskell,Doctest,我有一个使用FFI绑定到C函数的模块。如何使此模块使用doctest 运行doctest Foo.hs时出现的错误如下: ByteCodeLink: can't find label During interactive linking, GHCi couldn't find the following symbol: bar This may be due to you not asking GHCi to load extra object files, archives or DLLs

我有一个使用FFI绑定到C函数的模块。如何使此模块使用
doctest

运行
doctest Foo.hs
时出现的错误如下:

ByteCodeLink: can't find label
During interactive linking, GHCi couldn't find the following symbol:
  bar
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session.  Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
  glasgow-haskell-bugs@haskell.org

### Failure in Foo.hs:41: expression `foo'
expected: [42]
 but got: 
          <interactive>:24:1: Not in scope: `bar'
Examples: 2  Tried: 2  Errors: 0  Failures: 1
字节码链接:找不到标签
在交互式链接过程中,GHCi找不到以下符号:
酒吧
这可能是因为您没有要求GHCi加载额外的对象文件,
当前会话所需的存档或DLL。重新启动GHCi,并指定
缺少使用-L/path/to/object/dir和-lmissinglibname的库
标记,或仅通过在GHCi命令行上命名相关文件。
或者,此链接故障可能表示GHCi中存在错误。
如果您怀疑后者,请将错误报告发送至:
格拉斯哥哈斯克尔-bugs@haskell.org
###Foo.hs:41中的失败:表达式'Foo'
预期:[42]
但是得到:
:24:1:不在范围内:`bar'
示例:2尝试:2错误:0失败:1

Doctest接受任意GHC标志。如果要使用FFI代码运行Doctest,则需要传递与使用该代码运行GHCi会话所需的完全相同的标志。例如,查看。

根据doctest文档,您可以传递任意GHC标志。您是否尝试过按照错误中的说明进行操作?但是,如果您需要更具体的帮助,您必须向我们展示一些代码——足够让我们重现您的问题。