質問

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top