繁体   English   中英

使用带有钢筋的NIF编译项目:找不到cl.exe

[英]Compiling project with NIFs with rebar: cl.exe not found

我是Erlang和Rebar的新手。 在我的钢筋项目中,我使用了包含本机C代码的依赖项,并且在rebar compile期间出现错误:

Name cl.exe is not recognized as an internal or external command, operable program or batch file

我猜想钢筋正在尝试使用VisualStudio的Microsoft cl.exe编译器从依赖项编译c文件,对吗? 问题是我没有安装VS,也不想安装它。

为什么钢筋尝试使用cl.exe? 我可以将钢筋配置为使用其他编译器来编译c文件吗?

根据rebar.config 端口编译器代码中的注释,您可以通过在rebar.config添加类似的代码来提供替代的C编译器:

{port_env, [{"CC", "/path/to/gcc.exe"}]}.

您很可能必须更改CFLAGS以匹配编译器。 要编译NIF和端口,必须编译并提供OTP标头和开发库。

暂无
暂无

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

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