<div dir="ltr"><div>The windows build process&setup is not "magic" at all....</div><div><br></div>In fact it is actually possible to build Erlang/OTP with MSVC 2019<br>My build process (instructions not exact) looked like this:<br>1. Install MSVC 2019<br>2. Install MSYS2 and configure it so the msys shell inherits the Windows environment (PATH) when started. Also install all the "Linux" prereqs (GCC,...)<br>3. Download and build OpenSSL (follow OpenSSL build instructions, I used 1.1.1b version to get all possible ciphers, hashes,...)<br>4. Download and build wxWidgets (put wxWidgets in /opt/local/pgm and build the static libs there (instructions taken from OTP build guide for WIN, wxWidgets 3.0.4 is also fine):<br><br>C:\...\> cd <path\to\pgm>\wxMSW-3.0.3\build\msw<br>C:\...\> nmake TARGET_CPU=amd64 BUILD=release SHARED=0 DIR_SUFFIX_CPU= -f <a href="http://makefile.vc">makefile.vc</a><br><br><br>5. Apply this patch: <br>diff --git a/erts/etc/win32/msys_tools/vc/cc.sh b/erts/etc/win32/msys_tools/vc/cc.sh<br>index 2b0482e876..99db719c38 100644<br>--- a/erts/etc/win32/msys_tools/vc/cc.sh<br>+++ b/erts/etc/win32/msys_tools/vc/cc.sh<br>@@ -242,7 +242,10 @@ for x in $SOURCES; do<br>     if [ $PREPROCESSING = true ]; then<br>        output_flag="-E"<br>     else<br>+<br>        output_flag="-FS -c -Fo`cmd //C echo ${output_filename}`"<br>+       output_flag=`echo $output_flag | sed -e 's/\\//\\\\\\\\/g'`<br>+       #echo "PATCHED OUTPUT: " $output_flag<br>     fi<br>     params="$COMMON_CFLAGS $MD $DEBUG_FLAGS $OPTIMIZE_FLAGS \<br>            $CMD ${output_flag} $MPATH"<br><br>The cc.sh makes cl.exe look like gcc to the OTP build environment. It does fiddling with the paths to translate them from MSYS style to native paths. But it seems that MSVC 2019 does not like absolute paths with / insted of \ (Relative paths work fine with /)<br><br>5. Follow the WIN build instructions for OTP (tell configure where your OpenSSL lives):<br><br>$ eval `./otp_build env_win32 x64`<br>$ ./otp_build autoconf<br>$ ./otp_build configure  --with-ssl=/x/path/to/openssl #you might want to tell it where to find javac also if you want jinterface<div><br></div><div>Even if configure does not complainabout OpenSSL it seems that everythig is still not as the build environment expects. I had to copy libcrypto_static.lib and libssl_static.lib to c_src folder lib\crypto\c_src while renaming them to crypto.lib and ssl.lib.</div><div>Also It seems that I built OpenSSL with newtorking support since the OTP build died while building crypto app with unresolved winsock symbols. To fix it I added </div><div>LDFLAGS += -dll Ws2_32.Lib</div><div>to otp\lib\crypto\c_src\win32\Makefile (please keep in mind that this file is probably generated during the build process so this is a dirty hack, I did not feel like digging deeper into the build scripts, makefiles etc...)</div><div><br>$ ./otp_build boot -a<br>$ ./otp_build release -a<br><br>Building the installer expects a pretty ancient NSIS installation. I just removed the version checks in the installer makefile to go through that, but you really don't need the installer...</div><div><br></div><div>After ./otp_build release -a completes you will find everything you need in otp\release\win32. This is more or less what the installer will pack.</div><div><br></div><div>You can just copy that folder to wherever you want your build to live and run install.exe in that folder as the last step (this is also done by the windows installer)</div><div>It will create bin folder and put all the "public" exes there, set up an erl.ini and also copy the boot scripts into bin.</div><div><br></div><div>After that you are good to go! </div><div>I did not bother building the docs, but feel free to try that...</div><div><br></div><div>I confirmed that wx application is working by running observer and also did limited testing of the crypto app. </div><div><br></div><div>If you get stuck feel free to contact me</div><div>Cheers,</div><div>Jaka</div><div><div><br></div><div>On Tue, 30 Apr 2019 at 17:50, Andre Nathan <<a href="mailto:andre@digirati.com.br">andre@digirati.com.br</a>> wrote:<div>><br>> On 4/30/19 12:36 PM, Dmytro Lytovchenko wrote:<br>> >  From what I know the building instructions are pure magic involving<br>> > MinGW and Visual Studio, and it is dangerous to go alone.<br>> > Take this <a href="https://visualstudio.microsoft.com/vs/older-downloads/">https://visualstudio.microsoft.com/vs/older-downloads/</a><br>><br>> Yeah, I've found that, but the VS 2013 link leads to a page that says no<br>> downloads are available.<br>><br>> Thanks,<br>> Andre<br>> _______________________________________________<br>> erlang-questions mailing list<br>> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>> <a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a></div></div></div></div>