简体   繁体   English

Erlang:不能包含标题

[英]Erlang: Cannot include header

I start like this: 我开始是这样的:

[root@Oracle-linux-60 rabbitmq_server-3.5.6]# erl -pa ebin
Erlang/OTP 18 [erts-7.1] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V7.1  (abort with ^G)
1> -include("include/amqp_client.hrl").
** exception error: undefined shell command include/1

Why it doesn't recognize include ? 为什么不识别include

Erlang modules are really forms, but these directives are not 'Erlang' and can't be compiled, therefore this does not work. Erlang模块实际上是形式,但是这些指令不是'Erlang'并且不能编译,因此这是行不通的。

If you want to import records you can do it with rr("include/amqp_client.hrl"). 如果要导入记录,可以使用rr("include/amqp_client.hrl").

You can only enter expressions in the Erlang shell, and -include is not an expression. 您只能在Erlang Shell中输入表达式,而-include不是表达式。 Similarly you can't define named functions, declare modules, etc. See eg http://ulf.wiger.net/weblog/2007/11/20/extending-the-erlang-shell-part-1/ 同样,您不能定义命名函数,声明模块等。请参见例如http://ulf.wiger.net/weblog/2007/11/20/extending-the-erlang-shell-part-1/

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

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