如何在 ghc 中链接模块?

发布于 2024-09-28 01:56:51 字数 111 浏览 1 评论 0原文

我有一个使用 Data.Set 和 Data.IntMap 的 haskell 程序,我需要给 GHC 提供哪些标志才能让它链接这些库?我知道这是一个简单的问题,但是手册页对我没有帮助,我不知道该去哪里查找。

I have a haskell program that uses Data.Set and Data.IntMap, what flags do I need to give GHC to get it to link those libraries in? Simple question, I know, but the man pages didn't help me and I don't know where to look.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

打小就很酷 2024-10-05 01:56:51

添加 --make将告诉 GHC 查找所有依赖项并自动为您完成所有链接:

GHC 将计算出中的所有模块
通过以下导入来执行该程序
从这些初始模块。它将
然后尝试编译每个模块
这已经过时了,最后,如果
有一个 Main 模块,程序
也将被链接到
可执行文件。

Adding --make will tell GHC to find all the dependencies and do all the linking for you automatically:

GHC will figure out all the modules in
the program by following the imports
from these initial modules. It will
then attempt to compile each module
which is out of date, and finally, if
there is a Main module, the program
will also be linked into an
executable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文