用钢筋编制项目与NIFs:找不到cl.exe [英] Compiling project with NIFs with rebar: cl.exe not found
问题描述
rebar compile
中我收到错误: 名称cl.exe不被识别为内部或外部命令,可操作的程序或批处理文件
我想钢筋试图从VisualStudio中使用Microsoft的cl.exe编译器从我的依赖中编译c文件,对吧?问题是我没有安装VS,不想安装它。
为什么钢筋试图使用cl.exe?可以使用不同的编译器编译c文件吗?
根据 rebar端口编译器代码,您可以通过添加类似这样的代码来提供另一种C编译器到你的 rebar.config
:
{port_env,[{CC ,/path/to/gcc.exe}]}。
您很可能需要更改 CFLAGS
来匹配编译器。要编译NIF和端口,必须编译OTP头和开发库并提供。
I'm new to erlang and rebar. In my rebar project I used a dependency containing native c code and during rebar compile
I'm getting error:
Name cl.exe is not recognized as an internal or external command, operable program or batch file
I guess that rebar is trying to compile c files from my dependency using Microsoft's cl.exe compiler from VisualStudio, right? The problem is that I don't have VS installed and don't want to install it.
Why rebar is trying to use cl.exe? Can I configure rebar to use different compiler to compile c files?
According to the comments in the rebar port compiler code, you can provide an alternative C compiler by adding something like this to your rebar.config
:
{port_env, [{"CC", "/path/to/gcc.exe"}]}.
You will most likely have to change the CFLAGS
to match the compiler. To compile NIFs and ports the OTP headers and development libraries must be compiled and available.
这篇关于用钢筋编制项目与NIFs:找不到cl.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!