Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top