3

我尝试按照这个问题的答案中描述的方式进行操作。

我在工作目录中有ExampleModule.o文件ExampleModule.hi,我尝试加载ExampleModule.f函数。但我收到错误消息(详细级别设置为 3):

Failed to load interface for `ExampleModule':
  locations searched:
    ExampleModule.hs
    ExampleModule.lhs

packageIdString (thisPackage dynflags)"main"。_

我想那是因为我只能从已安装的包中加载模块。我对吗?有没有办法从独立对象文件动态加载函数,就像load函数plugins一样,但使用 GHC API?

4

0 回答 0