Build Erlang.mk development environment under Windows

The official website has written a lot of nonsense about using Erlang.mk under Windows, but it turns out that erlang cannot be started under Windows, which is embarrassing...

In fact, basically under linux is yum, apt is used to install related software packages, and then Erlang.mk can be used; what should be noted is the combination of Erlang.mk environment under windows. The general steps for setting up the environment are as follows:

 

1. Download and install msys2 on the msys2 official website (Erlang.mk must be msys2 in Windows environment), it is recommended to install it directly in the root directory of the C drive, and there should be no spaces in the path;

2. Start the msys2 console and update the msys2 environment with the following two commands:

        pacman --needed --noconfirm -Sy bash pacman pacman-mirrors msys2-runtime

        pacman --noconfirm -Syu

3. Install the git and make environments using the following commands:

        pacman -S git make

4. If you need to compile C/C++ code (basically no need under Windows...), you must use the following command to install gcc:

        pacman -S mingw-w64-x86_64-gcc

5. Download the Erlang installation package on the Erlang official website , and install it to the specified directory, assuming it is the opt directory of the D drive (the folder name in the path should preferably not have an empty string, I don’t know if there is a problem with an empty string);

6. Open the profile file in the etc directory in the msys2 environment (such as C:\msys64\etc\profile), and add the following two lines at the end of the file:

        ERL_HOME="/D/opt/erl9.2"
        PATH="${PATH}:${ERL_HOME}/bin"

PS: The /D in msys2 represents the D drive! ! ! ! ! !

7. Re-open the msys2 console, enter erl, and find that you have entered the erlang environment.

 

Then it's like using Erlang.mk under linux .

 

You can also check the integration of msys2 into eclipse under windows, and use Erlang.mk through eclipse under windows.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324409889&siteId=291194637