【问题标题】:How can I compile an Erlang file with includes from the erl shell?如何编译包含来自 erl shell 的 Erlang 文件?
【发布时间】:2020-12-27 20:51:02
【问题描述】:

命令行上的erlc -I <abspath-to-include-dir> <module>.erl正确编译<module>

但在 Erlang shell (erl) 中,以下会产生“找不到包含文件”的错误:

c(<module>, [{i, <abspath-to-include-dir>}]).

为什么?这两种编译文件的方式不应该是一样的吗?

【问题讨论】:

    标签: erlang erlang-shell


    【解决方案1】:

    尝试将路径写成目录列表,如{i, [".../here/", ".../there/"]},即使它只是一个目录。

    【讨论】:

    • 太棒了!谢谢你。有时我希望 shell 能够识别类型。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-16
    • 2021-12-31
    • 2013-01-09
    • 2021-11-14
    • 2013-03-25
    • 2015-08-29
    相关资源
    最近更新 更多