【问题标题】:Compiling project with NIFs with rebar: cl.exe not found使用带钢筋的 NIF 编译项目:找不到 cl.exe
【发布时间】:2013-02-09 04:25:12
【问题描述】:

我是 erlang 和 rebar 的新手。在我的 rebar 项目中,我使用了一个包含本机 c 代码的依赖项,在 rebar compile 期间出现错误:

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

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

为什么 rebar 尝试使用 cl.exe?我可以配置rebar使用不同的编译器编译c文件吗?

【问题讨论】:

    标签: erlang rebar


    【解决方案1】:

    根据rebar port compiler 代码中的 cmets,您可以通过在您的 rebar.config 中添加类似这样的内容来提供替代 C 编译器:

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

    您很可能必须更改CFLAGS 以匹配编译器。要编译 NIF 和端口,OTP 头文件和开发库必须已编译且可用。

    【讨论】:

      猜你喜欢
      • 2015-01-26
      • 2015-03-30
      • 2015-07-05
      • 1970-01-01
      • 1970-01-01
      • 2016-08-05
      • 2013-12-08
      • 2011-07-27
      • 2017-05-22
      相关资源
      最近更新 更多