Compiling project with NIFs with rebar: cl.exe not found

孤街浪徒 提交于 2019-12-09 23:39:11

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/15043040/compiling-project-with-nifs-with-rebar-cl-exe-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!