首页 文章

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

提问于
浏览
2

我是二郎和螺纹钢的新手 . 在我的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文件吗?

1 回答

  • 4

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

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

    您很可能必须更改 CFLAGS 以匹配编译器 . 要编译NIF和端口,必须编译OTP头和开发库并使其可用 .

相关问题