简体   繁体   English

如何加载二进制模块

[英]How to load binary module

Next compiles well 下一个编译良好

-module(cipher_id).
-export([a1/1]).

a1(I) ->
    binary:encode_unsigned(I).

But then i try to call cipher_id:a1(I) it crashes with 但是然后我尝试调用cipher_id:a1(I),它崩溃了

** exception error: undefined function binary:encode_unsigned/1 **异常错误:未定义函数二进制:encode_unsigned / 1

The same happened if try to call function from binary module in erl shell. 如果尝试从erl shell中的二进制模块调用函数,也会发生相同的情况。 m() outputs lists in which no binary module present. m()输出列表,其中不存在二进制模块。

From the Erlang documentation of the binary module : 二进制模块的Erlang文档中:

The module is implemented according to the EEP (Erlang Enhancement Proposal) 31. 该模块是根据EEP(Erlang增强建议)31实施的。

From the proposal page : 在提案页面中

Status: Final/R14A Proposal is implemented in OTP release R14A 状态:最终/ R14A提案已在OTP版本R14A中实施

You're using R13B03. 您正在使用R13B03。 My feeling is that you need to upgrade to a newer Erlang installation. 我的感觉是您需要升级到较新的Erlang安装。 Binaries for Ubuntu are available at: Ubuntu的二进制文件位于:

http://www.erlang-solutions.com/section/132/erlang-otp-packages http://www.erlang-solutions.com/section/132/erlang-otp-packages

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM