简体   繁体   English

Erlang 编译器找不到包含文件 test.hrl

[英]Erlang compiler cannot find include file test.hrl

I am having a project where suppose:我有一个项目,假设:

Project structure is root/p1/mod1/include/test.hrl and root/p2/mod2/foo.erl I have a erlang hrl file in root/p1/mod1/include and i have included it in erlang file (.erl) in root/p2/mod2项目结构是 root/p1/mod1/include/test.hrl 和 root/p2/mod2/foo.erl 我在 root/p1/mod1/include 中有一个 erlang hrl 文件,我已经将它包含在 erlang 文件 (.erl) 中在 root/p2/mod2

When I am compiling file foo.erl it gives following error:当我编译文件 foo.erl 时,它给出以下错误:

foo.erl:16: can't find include file "test.hrl"

I tried including it in -I flag of erlc such as below:我尝试将它包含在 erlc 的 -I 标志中,如下所示:

user[root/p2/mod2]$ erlc foo.erl -I "/local/user/root/p1/mod1/include"
foo.erl:16: can't find include file "test.hrl"

But it does not seem to solve it.但它似乎并没有解决它。 Can anyone help on how to resolve it?任何人都可以帮助解决它吗?

In Erlang , the command should be below:Erlang 中,命令应该在下面:

erlc flags file1.ext file2.ext... erlc 标志 file1.ext file2.ext...

Compiles one or more files.编译一个或多个文件。 The files must include the extension, for example, .erl for Erlang source code, or .yrl for Yecc source code.文件必须包含扩展名,例如,.erl 表示 Erlang 源代码,或 .yrl 表示 Yecc 源代码。 Erlc uses the extension to invoke the correct compiler Erlc 使用扩展来调用正确的编译器

The following flags are supported:支持以下标志:

-I 'Directory' -我'目录'

So just move your -I before erl file:所以只需在 erl 文件之前移动你的 -I :

erlc -I "/local/user/root/p1/mod1/include" foo.erl

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

相关问题 sed找不到文件 - sed cannot find file 脚本找不到现有文件 - Script cannot find existing file TeamCity系统找不到指定的文件 - TeamCity The system cannot find the file specified 无法将find命令的结果保存在文件中-文件为空 - cannot save the results of find command in a file - file is empty 尝试使用 sed 命令将此 var 包含在 test.txt 文件中以删除双引号 - Attempting to include this var in the test.txt file using sed command to remove double quotes Java执行shell命令-错误[无法运行程序“sh”:CreateProcess错误=2,系统找不到指定的文件] - Java execute shell command - error [Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified] 为什么cygwin ls可以使cygwin cron找不到文件? - why cygwin cron cannot find a file when cygwin ls can? 在Spring Shell中运行date命令(“无法运行程序……系统找不到指定的文件”) - Run the date command in Spring Shell (“Cannot run program … the system cannot find the file specified”) wshShell.Exec错误80070002“系统找不到指定的文件” - wshShell.Exec Error 80070002 “The system cannot find the file specified” vb.net 找不到指定的文件“”C:\\Users“” - vb.net Cannot find file specified “”C:\Users“”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM