问题
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